TSTypeCastExpression should not be inside call parameters (#10939)

This commit is contained in:
Huáng Jùnliàng
2019-12-30 16:10:19 -05:00
committed by GitHub
parent 197a8da04d
commit 86245a83a2
3 changed files with 168 additions and 5 deletions

View File

@@ -2568,11 +2568,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
): $ReadOnlyArray<?N.Expression> {
for (let i = 0; i < exprList.length; i++) {
const expr = exprList[i];
if (
expr &&
expr._exprListItem &&
expr.type === "TsTypeCastExpression"
) {
if (expr && expr.type === "TSTypeCastExpression") {
this.raise(expr.start, "Did not expect a type annotation here.");
}
}