Closed
Description
TypeScript Version: 3.0.0-dev.20180621
Search Terms:
Code
import * as ts from 'typescript';
const n = ts.createStatement(ts.createAsExpression(ts.createObjectLiteral(), ts.createTypeReferenceNode('any', undefined)));
ts.createPrinter().printNode(ts.EmitHint.Unspecified, n, ts.createSourceFile('dummy.ts', '', ts.ScriptTarget.Latest));
Expected behavior:
({} as any);
The same applies to NonNullExpression
.
Actual behavior:
Invalid code, this is a syntax error: {} as any;