Add comment to new code in hasExcessProperties

This commit is contained in:
Nathan Shively-Sanders
2017-06-14 15:13:46 -07:00
parent a7d7a4cedf
commit 1dd9e9b9e9

View File

@@ -8955,6 +8955,7 @@ namespace ts {
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(prop), typeToString(target));
}
else {
// use the property's value declaration if the property is assigned inside the literal itself
const objectLiteralDeclaration = source.symbol && firstOrUndefined(source.symbol.declarations);
if (prop.valueDeclaration && findAncestor(prop.valueDeclaration, d => d === objectLiteralDeclaration)) {
errorNode = prop.valueDeclaration;