TypeScript Version:
nightly (1.9.0-dev.20160419)
Code
Ember.Object.extend({
init() {
this._super();
// ^~~~ error TS2339: Property '_super' does not exist on type '{ init(): void; }'.
...
}
});
Expected behavior:
this should be inferred as any
Actual behavior:
this is inferred to be { init(): void; }
This changed somewhere between typescript@1.9.0-dev.20160319 and typescript@1.9.0-dev.20160419. I believe it is unsafe to assume anything about the this on the "methods" on a POJO, as there are several common patterns in JavaScript that breaks this assumption (using POJOs as an "options" or "extensions" dictionary).
TypeScript Version:
nightly (1.9.0-dev.20160419)
Code
Expected behavior:
thisshould be inferred asanyActual behavior:
thisis inferred to be{ init(): void; }This changed somewhere between
typescript@1.9.0-dev.20160319andtypescript@1.9.0-dev.20160419. I believe it is unsafe to assume anything about thethison the "methods" on a POJO, as there are several common patterns in JavaScript that breaks this assumption (using POJOs as an "options" or "extensions" dictionary).