mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 09:24:19 -06:00
Fixed crash when resolving a symbol on invalid private identifier in type reference (#60013)
This commit is contained in:
parent
aa9df4d687
commit
e962037df3
@ -49143,15 +49143,14 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
return resolveJSDocMemberName(name);
|
||||
}
|
||||
}
|
||||
else if (isTypeReferenceIdentifier(name as EntityName)) {
|
||||
else if (isEntityName(name) && isTypeReferenceIdentifier(name)) {
|
||||
const meaning = name.parent.kind === SyntaxKind.TypeReference ? SymbolFlags.Type : SymbolFlags.Namespace;
|
||||
const symbol = resolveEntityName(name as EntityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
|
||||
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name as EntityName);
|
||||
const symbol = resolveEntityName(name, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true);
|
||||
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
|
||||
}
|
||||
if (name.parent.kind === SyntaxKind.TypePredicate) {
|
||||
return resolveEntityName(name as Identifier, /*meaning*/ SymbolFlags.FunctionScopedVariable);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @target: esnext
|
||||
|
||||
//// class Foo {
|
||||
//// #prop: string = "";
|
||||
////
|
||||
//// method() {
|
||||
//// const test: Foo.#prop/*1*/ = "";
|
||||
//// }
|
||||
//// }
|
||||
|
||||
verify.quickInfoAt("1", "");
|
||||
Loading…
x
Reference in New Issue
Block a user