Treat Never as dynamic
The TypeScript compiler will often transform Anys into Nevers when it
thinks control flow cannot reach a certain point.  This isn't handled
gracefully at the moment.  This change just erases it back to Any.
@@ -773,7 +773,7 @@ export class Transformer {
let flags: ts.TypeFlags;
[ simple, flags ] = this.simplifyTypeForToken(ty);
- if (flags & ts.TypeFlags.Any) {
+ if (flags & (ts.TypeFlags.Any | ts.TypeFlags.Never)) {
return tokens.dynamicType;
}
else if (flags & ts.TypeFlags.String) {
