Skip to content

Use the value symbol for decorator purpose only if it is same as type symbol #13584

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

Merged
merged 2 commits into from
Jan 20, 2017

Conversation

sheetalkamat
Copy link
Member

Fixes #13155


// Resolve the symbol as a type so that we can provide a more useful hint for the type serializer.
const typeSymbol = resolveEntityName(typeName, SymbolFlags.Type, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location);
if (valueSymbol && valueSymbol === typeSymbol) {
Copy link

Choose a reason for hiding this comment

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

just wanna be enlightened about how Typescript type checker works:

if there's already a value called "Event" (like the DOM.Event class) and there is a type declared that is named "Event" and they are equal, we will assume that the reference is to the type rather than to the value?

Copy link
Contributor

Choose a reason for hiding this comment

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

declarations do merge in TS, see http://www.typescriptlang.org/docs/handbook/declaration-merging.html for more details.

@ghost
Copy link

ghost commented Jan 20, 2017

thanks for fixing this bug!! 🍾 💯

@sheetalkamat sheetalkamat merged commit a185ddc into master Jan 20, 2017
@sheetalkamat sheetalkamat deleted the decoratorMetadata branch January 20, 2017 21:46
@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.

3 participants