From d5fd34b03718b851adad6c25f7de880ef20173b3 Mon Sep 17 00:00:00 2001 From: Gabriela Araujo Britto Date: Thu, 23 Mar 2023 14:49:53 -0300 Subject: [PATCH] Don't error when calling `resolveEntityName` (#53441) --- src/compiler/checker.ts | 2 +- tests/cases/fourslash/classSymbolLookup.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/classSymbolLookup.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8dd57a864e5..4bc28b8f11e 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -45309,7 +45309,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; if (entityNameSymbol) { return entityNameSymbol; } diff --git a/tests/cases/fourslash/classSymbolLookup.ts b/tests/cases/fourslash/classSymbolLookup.ts new file mode 100644 index 00000000000..fca63b6174c --- /dev/null +++ b/tests/cases/fourslash/classSymbolLookup.ts @@ -0,0 +1,15 @@ +/// + +// Issue #53247 + +//// class Foo { +//// private constructor(value : T, context: C){ } +//// static readonly makeFoo = (context : C) => +//// (value : T) => +//// new Foo(value, context); +//// } +//// const x = Foo.makeFoo<{}>; +//// x({}); + +verify.encodedSemanticClassificationsLength("2020", 75); +verify.getSemanticDiagnostics([]); \ No newline at end of file