mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
Move assignment to error span reset, and give some explanation.
This commit is contained in:
parent
471eb5b413
commit
657b3e00ee
@ -12234,7 +12234,12 @@ 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)) {
|
||||
@ -12250,7 +12255,6 @@ namespace ts {
|
||||
reportError(Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
||||
symbolToString(prop), typeToString(errorTarget));
|
||||
}
|
||||
shouldConstructDiagnosticTrail = false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user