Closed
Description
I am using the following example that I took directly from the blog post (http://blogs.msdn.com/b/typescript/archive/2014/11/18/what-s-new-in-the-typescript-type-system.aspx)
var x: any = "foo";
if(typeof x === 'string') {
console.log(x.subtr(1)); // Error, 'subtr' does not exist on 'string'
}
// x is still any here
x.unknown(); // OK
I am not seeing the error or intellisense for the console.log statement.
Are type guards actually supported in this case or only for union types?