From 9746252b92e4a0d986e7b2acc93ef385f7b4cf7f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 5 Feb 2019 18:16:06 -0800 Subject: [PATCH] Move the line back to the bottom. --- src/compiler/checker.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9e2ab97e45c..96d03ac24c4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -12234,12 +12234,7 @@ namespace ts { const propDeclaration = prop.valueDeclaration as ObjectLiteralElementLike; Debug.assertNode(propDeclaration, isObjectLiteralElementLike); - // Give a specific error message span on the property declaration, and signal - // to the rest of the relationship check not to provide the trail of context. - // We don't want to overwhelm our users with the context, and hopefully they - // already have enough information to piece this together. errorNode = propDeclaration; - shouldConstructDiagnosticTrail = false; const name = propDeclaration.name!; if (isIdentifier(name)) { @@ -12255,6 +12250,13 @@ namespace ts { reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1, symbolToString(prop), typeToString(errorTarget)); } + + // Signal to the rest of the relationship check not to provide the trail of context. + // We don't want to overwhelm our users with the context, and hopefully they + // already have enough information to piece this together. + // NOTE: don't move this closer to the re-assignment of `errorNode` since + // this needs to happen *after* reporting errors at this level. + shouldConstructDiagnosticTrail = false; } } return true;