Also erase TypeLiterals

This change erases TypeLiterals to ObjectLiterals, for much the same reason.
Also for much the same reason, it'd be nice to eventually preserve these.
This commit is contained in:
joeduffy 2017-02-11 14:51:05 -08:00
parent a7f23fc65a
commit 10f5d43245

View file

@ -629,8 +629,8 @@ export class Transformer {
return undefined; // void is represented as the absence of a type.
}
else if (simple.symbol) {
if (simple.symbol.flags & ts.SymbolFlags.ObjectLiteral) {
// For object literals, simply return the dynamic type.
if (simple.symbol.flags & (ts.SymbolFlags.ObjectLiteral | ts.SymbolFlags.TypeLiteral)) {
// For object and type literals, simply return the dynamic type.
// TODO: consider emitting strong types for these and using them anonymously.
return tokens.dynamicType;
}