TypeScript/tests/baselines/reference/typeGuardsWithAny.js
2014-12-10 10:17:48 -08:00

12 lines
259 B
JavaScript

//// [typeGuardsWithAny.ts]
var x: any = { p: 0 };
if (x instanceof Object) {
x.p; // No error, type any is not narrowed
}
//// [typeGuardsWithAny.js]
var x = { p: 0 };
if (x instanceof Object) {
x.p; // No error, type any is not narrowed
}