-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Generic type parameters considered private in protected methods when generating .d.ts #1445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not seeing this on the latest bits. Is there something more to the repro? |
I apologize, this only manifests if "Generate declaration files" is selected for the project. |
Ah, there we go :) |
This issue is a mismatch between the checker visibility rules and the emitter output rules. The checker's determineIfDeclarationIsVisible function considers a Protected method to be not visible. However, the emitter's emitParameterDeclaration and emitSignatureDeclaration functions will emit parameter/return types for non-Private methods. Thus protected methods cause emitting of a non-visible type, resulting in a "of_public_method_from_exported_class_has_or_is_using_private_name" class of error. I don't have sufficient knowledge of the codebase to submit a PR, but time-permitting it would be fantastic if a fix could make it into the 1.4 release. Our organization relies on .d.ts generation as a means of simulating .dlls, such that we can depend on a common set of "library" projects for our various application projects. This defect would in many instances prevent using protected in such libraries. |
This was broken by 1.4, it worked in 1.3. |
We have an issue arising from the fact that this worked in 1.3 but not in 1.4. Is it possible for a fix for this to be made for the 1.4 release. Otherwise, we're gonna have a back-compat break. |
Referenced PR got cherry-picked into 1.4 |
Awesome, thanks for the quick fix! |
The following code fails in TypeScript 1.4 with the below errors:
Parameter 'val' of public method from exported class has or is using private name 'T'.
Return type of public method from exported class has or is using private name 'T'.
The text was updated successfully, but these errors were encountered: