Closed
Description
TypeScript Version: 2.1.1 / nightly (2.1.0-dev.20161109)
Code
class Exception extends Error {
constructor(msg: string) {
super(msg);
}
public printMsg() {
console.log(this.message);
}
}
let e = new Exception("testing!");
e.printMsg(); // printMsg is now undefined
Expected behavior:
Members defined on the extending class should be available for use. This worked fine a few days ago for me in 2.0.x. Upgrading to 2.1.x I have seen this issue.
Actual behavior:
Members are undefined.
It's possible I may be doing something wrong here but it seems to me that this should work. I wonder if this has anything to do with how inheritance is generated to support Custom Elements (https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#use-returned-values-from-super-calls-as-this)
Metadata
Metadata
Assignees
Labels
No labels