TypeScript Version: 2.0.3
Code
let Obj = {
get () {},
set ( value = Obj.get () ) {}
};
Obj.missing (); // Obj is treated as `any`, so I don't get any error for the usage of the undefined method `missing`
Expected behavior:
I expect to get an error for the usage of the undefined method Obj.missing.
Actual behavior:
I don't get any, since if I use Obj within a default argument inside one of Obj's own methods the entire object type becomes any.
Ugly workaround:
let _self;
let Obj = _self = {
get () {},
set ( value = _self.get () ) {}
};
Obj.missing (); // I get an error as expected