Skip to content

[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

Closed
wants to merge 4 commits into from

Conversation

yuit
Copy link
Contributor

@yuit yuit commented Sep 26, 2016

Fix #11035.

TODO

  • Add tests

@yuit yuit added this to the TypeScript 2.0.5 milestone Sep 26, 2016
@@ -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;
Copy link
Member

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);```

Copy link
Contributor Author

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;
Copy link
Member

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?

Copy link
Contributor Author

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)) {
Copy link
Member

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 |

Copy link
Contributor Author

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)) {
Copy link
Member

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 |

@mhegazy mhegazy removed this from the TypeScript 2.0.5 milestone Oct 5, 2016
@yuit
Copy link
Contributor Author

yuit commented Oct 5, 2016

Closing this PR in flavor of fix in the master branch

@yuit yuit closed this Oct 5, 2016
@yuit yuit deleted the fix11035_2.0.5 branch October 5, 2016 17:40
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants