Skip to content

Conversation

mylesmegyesi
Copy link
Contributor

Fixes #12075

@DanielRosenwasser DanielRosenwasser merged commit 4701eb7 into microsoft:master Nov 23, 2016
@DanielRosenwasser
Copy link
Member

Thanks for the fix!

@mylesmegyesi mylesmegyesi deleted the 12075-incorrectErrorMessageForUseOfTypeAsNamespace branch November 23, 2016 16:35
@mhegazy mhegazy mentioned this pull request Nov 23, 2016
@@ -1032,6 +1033,18 @@ namespace ts {
}
}

function checkAndReportErrorForUsingTypeAsNamespace(errorLocation: Node, name: string, meaning: SymbolFlags): boolean {
if (meaning === SymbolFlags.Namespace) {
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.Type & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined));
Copy link
Member

Choose a reason for hiding this comment

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

SymbolFlags.Type & ~SymbolFlags.Value excludes classes and enums. Was that intentional? cc @DanielRosenwasser

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it should have been & ~SymbolFlags.Namespace instead

Copy link
Member

Choose a reason for hiding this comment

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

I could be missing something, but I don't think SymbolFlags.Type includes SymbolFlags.Namespace.

@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.

5 participants