Skip to content
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

In services, show the aliasSymbol for a type even if it's not accessible in the current scope #17433

Merged
3 commits merged into from
Aug 15, 2017

Conversation

ghost
Copy link

@ghost ghost commented Jul 26, 2017

Fixes #17322
This may show an unexpected type due to #17349 -- if there is type T = string | number somewhere and you happen to also have string | number in your file, you will see T. But such situations will hopefully be rare.

@@ -2691,6 +2691,8 @@ namespace ts {
AddUndefined = 1 << 13, // Add undefined to types of initialized, non-optional parameters
WriteClassExpressionAsTypeLiteral = 1 << 14, // Write a type literal instead of (Anonymous class)
InArrayType = 1 << 15, // Writing an array element type
UseAliasEvenIfNotAccessible = 1 << 16, // For a `type T = ... ` defined in a different file, write `T` instead of its value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "defined outside the current scope"?

@@ -2691,6 +2691,8 @@ namespace ts {
AddUndefined = 1 << 13, // Add undefined to types of initialized, non-optional parameters
WriteClassExpressionAsTypeLiteral = 1 << 14, // Write a type literal instead of (Anonymous class)
InArrayType = 1 << 15, // Writing an array element type
UseAliasEvenIfNotAccessible = 1 << 16, // For a `type T = ... ` defined in a different file, write `T` instead of its value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems suspiciously correlated to UseTypeAliasValue. I'm not sure what the right way to emphasize the difference is, but it seems like a smell.

Copy link
Author

@ghost ghost Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like that flag isn't used. (#17779)

@ghost ghost force-pushed the usealias branch from f9b58e9 to eec5453 Compare August 14, 2017 21:56
@ghost
Copy link
Author

ghost commented Aug 14, 2017

@aozgaa, good to go?

@aozgaa
Copy link
Contributor

aozgaa commented Aug 15, 2017

LGTM

@ghost ghost merged commit 10c8d5e into master Aug 15, 2017
@ghost ghost deleted the usealias branch August 15, 2017 17:23
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This pull request was closed.
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.

2 participants