-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Report errors for usage of private types when generating declaration file #161
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
Conversation
…mbols when writing types in declaration file
…vate type/module Fixes #86
} | ||
private static myPrivateStaticMethod<T extends privateClass>() { | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! TypeParameter 'T' of public static method from exported class has or is using private name 'privateClass'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error message is wrong here -- the method is not public. Related: logged #163
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this. thanks for finding this
…ype parameter constraint of private methods Also incorporates code review feedback
@@ -645,7 +645,7 @@ module ts { | |||
} | |||
|
|||
// If symbol is directly available by its name in the symbol table | |||
if (isAccessible(symbols[symbol.name])) { | |||
if (hasProperty(symbols, symbol.name) && isAccessible(symbols[symbol.name])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a lookup method for Map, it would be more consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will update that when I resolve merge conflicts.
👍 |
Report errors for usage of private types when generating declaration file
Currently this change reports errors only for heritage clause and constraints of type parameters if the name is not public