mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-17 12:19:32 -05:00
Use first declaration, not valueDeclaration
valueDeclaration is frequently not set
This commit is contained in:
@@ -8955,7 +8955,7 @@ namespace ts {
|
||||
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
|
||||
}
|
||||
else {
|
||||
const objectLiteralDeclaration = source.symbol && source.symbol.valueDeclaration;
|
||||
const objectLiteralDeclaration = source.symbol && firstOrUndefined(source.symbol.declarations);
|
||||
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, d => d === objectLiteralDeclaration)) {
|
||||
errorNode = prop.valueDeclaration;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user