-
Notifications
You must be signed in to change notification settings - Fork 12.9k
[Release-2.0.5] Fix 11035: missing generic in .d.ts emit #11154
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
@@ -2121,12 +2121,16 @@ namespace ts { | |||
} | |||
|
|||
function buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]) { | |||
const globalFlagsToPass = globalFlags & TypeFormatFlags.WriteOwnNameForAnyLike; | |||
let globalFlagsToPass = globalFlags & TypeFormatFlags.WriteOwnNameForAnyLike; |
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.
let globalFlagsToPass = globalFlags & (TypeFormatFlags.WriteOwnNameForAnyLike | TypeFormatFlags.UseTypeAliasValue);```
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.
then that will make we serialize type-alias all the time. THough we won't want to do that for quickinfo I think. because in if we want to serialize type-alias all the time, we can just remove the check completely
@@ -2121,12 +2121,16 @@ namespace ts { | |||
} | |||
|
|||
function buildTypeDisplay(type: Type, writer: SymbolWriter, enclosingDeclaration?: Node, globalFlags?: TypeFormatFlags, symbolStack?: Symbol[]) { | |||
const globalFlagsToPass = globalFlags & TypeFormatFlags.WriteOwnNameForAnyLike; | |||
let globalFlagsToPass = globalFlags & TypeFormatFlags.WriteOwnNameForAnyLike; |
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.
let globalFlagsToPass = globalFlags & (TypeFormatFlags.WriteOwnNameForAnyLike | TypeFormatFlags.UseTypeAliasValue);```
Is similar change needed in master?
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.
not at all. So this is just address an issue for release-2.0.5 the master uses accessibility check (check accessibility allows we to correctly check local type)
else { | ||
writeUnionOrIntersectionType(<UnionOrIntersectionType>type, nextFlags); | ||
} | ||
else if (!(flags & TypeFormatFlags.InTypeAlias) && type.flags & (TypeFlags.Anonymous | TypeFlags.UnionOrIntersection) && type.aliasSymbol && !(flags & TypeFormatFlags.UseTypeAliasValue)) { |
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.
again can we combine InTypeAlias and UseTypeAliasValue with |
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.
not sure I understand what you mean. 😅 I will catch you offline tmr. I think it may be better to just serialize type-alias all the time
else { | ||
writeUnionOrIntersectionType(<UnionOrIntersectionType>type, nextFlags); | ||
} | ||
else if (!(flags & TypeFormatFlags.InTypeAlias) && type.flags & (TypeFlags.Anonymous | TypeFlags.UnionOrIntersection) && type.aliasSymbol && !(flags & TypeFormatFlags.UseTypeAliasValue)) { |
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.
again can we combine InTypeAlias and UseTypeAliasValue with |
Closing this PR in flavor of fix in the master branch |
Fix #11035.
TODO