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:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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', () => {
|
||||
|
Reference in New Issue
Block a user