Merge pull request #27669 from Microsoft/betterErrorForAccidentalCall

Always emit diagnostic when a call expression can be fixed by adding a semicolon
This commit is contained in:
Daniel Rosenwasser
2018-11-12 14:50:23 -08:00
committed by GitHub
8 changed files with 86 additions and 85 deletions

View File

@@ -20101,7 +20101,7 @@ namespace ts {
}
else {
let relatedInformation: DiagnosticRelatedInformation | undefined;
if (node.arguments.length === 1 && isTypeAssertion(first(node.arguments))) {
if (node.arguments.length === 1) {
const text = getSourceFileOfNode(node).text;
if (isLineBreak(text.charCodeAt(skipTrivia(text, node.expression.end, /* stopAfterLineBreak */ true) - 1))) {
relatedInformation = createDiagnosticForNode(node.expression, Diagnostics.It_is_highly_likely_that_you_are_missing_a_semicolon);