feat(compiler-cli): add support for TypeScript 4.0 (#38076)

With this change we add support for TypeScript 4.0

PR Close #38076
This commit is contained in:
Alan Agius
2020-07-15 12:21:04 +02:00
committed by Misko Hevery
parent 201a546af8
commit 0fc44e0436
37 changed files with 315 additions and 141 deletions

View File

@ -849,7 +849,7 @@ function getTsTypeFromBuiltinType(builtinType: BuiltinType, ctx: TypeContext): t
`Internal error, unhandled literal kind ${builtinType}:${BuiltinType[builtinType]}`);
}
const node = ts.createNode(syntaxKind);
node.parent = ts.createEmptyStatement();
(node.parent as ts.Node) = ts.createEmptyStatement();
return ctx.checker.getTypeAtLocation(node);
}

View File

@ -50,7 +50,7 @@ describe('plugin', () => {
const diags = plugin.getSemanticDiagnostics(fileName);
expect(diags.length).toBe(1);
expect(diags[0].messageText)
.toBe(`Argument of type '"hello"' is not assignable to parameter of type 'number'.`);
.toBe(`Argument of type 'string' is not assignable to parameter of type 'number'.`);
});
it('should not report TypeScript errors on tour of heroes', () => {