We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
class ClassA{ protected _id:number = 1; public get id():number{ return this._id; } public set id(value:number){ this.id = value; } } class ClassB extends ClassA{ public get id():number{ return this._id; } public set id(value:number){ this.id = value; } } class ClassC extends ClassB{ public set id(value:number){ this.id = value; } } class ClassD extends ClassB{ } let myClassA = new ClassA(); let myClassB = new ClassB(); let myClassC = new ClassC(); let myClassD = new ClassD();
Expected behavior:
console.log("myClassA : ", myClassA.id); //1 console.log("myClassB : ", myClassB.id); //1 console.log("myClassC : ", myClassC.id); //1 console.log("myClassD : ", myClassD.id); //1
Actual behavior:
console.log("myClassA : ", myClassA.id); //1 console.log("myClassB : ", myClassB.id); //1 console.log("myClassC : ", myClassC.id); //UNDEFINED console.log("myClassD : ", myClassD.id); //1
The text was updated successfully, but these errors were encountered:
This is the ES6-specified behavior. See #13669, #13432, #11596
Sorry, something went wrong.
Alright thank you for clarification.
No branches or pull requests
TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: