Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45308,7 +45308,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}

meaning |= SymbolFlags.Alias;
const entityNameSymbol = isEntityNameExpression(name) ? resolveEntityName(name, meaning) : undefined;
const entityNameSymbol = isEntityNameExpression(name) ? resolveEntityName(name, meaning, /*ignoreErrors*/ true) : undefined;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's my understanding that we expect that this resolveEntityName call might fail, judging from the if statement below and the rest of the code (and an earlier resolve call that also ignores errors)`, so we shouldn't report errors here.

if (entityNameSymbol) {
return entityNameSymbol;
}
Expand Down
20 changes: 20 additions & 0 deletions tests/cases/fourslash/classSymbolLookup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/// <reference path="fourslash.ts" />

// Issue #53247

//// class Foo<T extends Object, C extends {}> {
//// private constructor(value : T, context: C){ }

//// static readonly makeFoo = <C extends {}>(context : C) =>
//// <T extends Object>(value : T) =>
//// new Foo<T, C>(value, context);
//// }

//// const x = Foo.makeFoo<{}>; //// Cannot find name 'Foo'.ts(2304)
//// //// 'Foo' only refers to a type, but
//// //// is being used as a namespace here.ts(2702)

//// x({}); // 👍 `const x: <{}>(context: {}) => <T>(value: T) => Foo<T, {}>`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the comments are helpful for the issue, but are confusing here for the test case.


verify.encodedSemanticClassificationsLength("2020", 75);
verify.getSemanticDiagnostics([]);