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.0-dev.20170202
#13743
Code
type Constructor<T> = new(...args: any[]) => T; class A { public pb: number = 2; protected ptd: number = 1; private pvt: number = 0; } function mixB<T extends Constructor<{}>>(Cls: T) { return class extends Cls { protected ptd: number = 10; //override private pvt: number = 0; //hiding try }; } function mixB2<T extends Constructor<A>>(Cls: T) { return class extends Cls { protected ptd: number = 10; //override //private pvt: number = 0; //hiding try failded: TS2415 }; } const AB = mixB(A), AB2 = mixB2(A); function mixC<T extends Constructor<{}>>(Cls: T) { return class extends Cls { protected ptd: number = 100; //override private pvt: number = 0; //hiding try }; } const AB2C = mixC(AB2), ABC = mixC(AB); const a = new A(), ab = new AB(), abc = new ABC(), ab2c = new AB2C();
Expected behavior:
a.pb.toFixed(); //ok a.ptd.toFixed(); //error: TS2445 a.pvt.toFixed(); //error: TS2341 ab.pb.toFixed(); //ok ab.ptd.toFixed(); //error: TS2445 ab.pvt.toFixed(); //error: TS2341 abc.pb.toFixed(); //ok abc.ptd.toFixed(); //error: TS2445 abc.pvt.toFixed(); //error: TS2341 ab2c.pb.toFixed(); //ok ab2c.ptd.toFixed(); //error: TS2445 ab2c.pvt.toFixed(); //error: TS2341
Actual behavior:
a.pb.toFixed(); //ok a.ptd.toFixed(); //ok error: TS2445 a.pvt.toFixed(); //ok error: TS2341 ab.pb.toFixed(); //ok ab.ptd.toFixed(); //ok =( ab.pvt.toFixed(); //ok =( abc.pb.toFixed(); //ok abc.ptd.toFixed(); //ok =( abc.pvt.toFixed(); //ok =( ab2c.pb.toFixed(); //ok ab2c.ptd.toFixed(); //ok =( ab2c.pvt.toFixed(); //ok =(
The text was updated successfully, but these errors were encountered:
ahejlsberg
Successfully merging a pull request may close this issue.
TypeScript Version: 2.2.0-dev.20170202
#13743
Code
Expected behavior:
Actual behavior:
The text was updated successfully, but these errors were encountered: