-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Serialize inferred type alias when type alias symbol is not accessible #10953
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
* Check if the given symbol in given enclosing declaration is accessible and mark all associated alias to be visible if requested | ||
* | ||
* @param symbol a Symbol to check if accessible | ||
* @param enclosingDeclaration a Node containing the symbol |
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.
a Node containing reference to the symbol?
if (aliasesToMakeVisible) { | ||
if (!contains(aliasesToMakeVisible, anyImportSyntax)) { | ||
aliasesToMakeVisible.push(anyImportSyntax); | ||
if (shouldComputeAliasToMarkVisible) { |
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.
This seems not completely correct. Because You wouldn't be making the alias visible yet returning that the declaration is visible. At the consumer side say result of all this is that the symbol is visible. (not the false case that you have marked) then you definitely going to get error in the .d.ts file because you should have made the alias visible for the correct emit of the declaration file but it isn't going to be emitted.
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 think I get it why it works because here you just check if this is visible but the tracking of the symbol does happen again when actually writing the symbol. Probably we need a comment here explaining that.
@@ -1830,7 +1838,7 @@ namespace ts { | |||
return isAmbientModule(declaration) || (declaration.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(<SourceFile>declaration)); | |||
} | |||
|
|||
function hasVisibleDeclarations(symbol: Symbol): SymbolVisibilityResult { | |||
function hasVisibleDeclarations(symbol: Symbol, shouldComputeAliasToMarkVisible: boolean): SymbolVisibilityResult { |
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.
MarkVisible
or MakeVisible
?
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.
make :)
👍 |
No description provided.