Closed
Description
TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20170102)
Code
class Tween<T>{
static get<T>(target: T): Tween<T> {
return new Tween(target);
}
constructor(private target: T) {
}
public to(props: Partial<T>) {
}
}
class DisplayObject {
public x: number;
public y: number;
}
class Button extends DisplayObject {
public z: number;
onClick = () => {
let tween = Tween.get(this);
tween.to({ x: 100 });
tween.to({ z: 100 });
tween.to({ a: 100 });
}
}
Expected behavior:
let tween = Tween.get(this);
tween.to({ x: 100 }); // right
tween.to({ z: 100 }); // right
tween.to({ a: 100 }); // compile error
Actual behavior:
let tween = Tween.get(this);
tween.to({ x: 100 }); // compile error
tween.to({ z: 100 }); // compile error
tween.to({ a: 100 }); // compile error