We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d719de5 commit ef70a6cCopy full SHA for ef70a6c
src/compiler/checker.ts
@@ -8955,6 +8955,7 @@ namespace ts {
8955
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
8956
}
8957
else {
8958
+ // use the property's value declaration if the property is assigned inside the literal itself
8959
const objectLiteralDeclaration = source.symbol && firstOrUndefined(source.symbol.declarations);
8960
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, d => d === objectLiteralDeclaration)) {
8961
errorNode = prop.valueDeclaration;
0 commit comments