From 1dd9e9b9e91ab488d2d57e24433f06b1697a33d7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 14 Jun 2017 15:13:46 -0700 Subject: [PATCH] Add comment to new code in hasExcessProperties --- src/compiler/checker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 538a80e955a..6d62d7b67d9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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;