Skip to content

Resolve the decorator type as type and check if the symbol has value. #4386

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 7 commits into from
Aug 24, 2015

Conversation

sheetalkamat
Copy link
Member

This would make sure we are referencing correct symbol to check if it has value
Fixes #4239

This would make sure we are referencing correct symbol to check if it has value
Fixes #4239
let rootSymbol = resolveName(root, root.text, SymbolFlags.Value, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined);
if (rootSymbol && rootSymbol.flags & SymbolFlags.Alias && !isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(rootSymbol))) {
markAliasSymbolAsReferenced(rootSymbol);
var meaning = root.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure i understand this line.

Copy link
Member Author

Choose a reason for hiding this comment

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

If it is M.Q then resolving M has to be like namespace. While if it is T , T need sto be resolved as type.

Copy link
Contributor

Choose a reason for hiding this comment

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

use let

@yuit
Copy link
Contributor

yuit commented Aug 21, 2015

Please add more tests

@mhegazy
Copy link
Contributor

mhegazy commented Aug 21, 2015

👍 but please add some more tests for the namespace/dotted name case. this area does not have enough coverage.
also i would add a unit test in https://github.com/Microsoft/TypeScript/blob/master/tests/cases/unittests/transpile.ts to cover this example in ts.transpile cases.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 24, 2015

👍

sheetalkamat added a commit that referenced this pull request Aug 24, 2015
Resolve the decorator type as type and check if the symbol has value.
@sheetalkamat sheetalkamat merged commit b8c8dbc into master Aug 24, 2015
@sheetalkamat sheetalkamat deleted the importDeclarationAndDecorator branch August 24, 2015 21:32
@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