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
private, protected
Version 5.6.2
https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwChC5S4woIZgFqATOGACwEs0BJNABUutuAYBeOAEYA3CTIUWANxTVGrDtyiz5wOMPHEycAEYooACgCUALhx4iu3QggA7NPGbzNithJtlJXqMBgArlD2cPbAAO6IqBhwoNT2dJiWBDpeNmgQALb+rPYA5qYpacVwfoHBivIAdMxsnDxqCgDUlTA1SvW8NPSeJaQAvj42g7qD-UA
export class Foo { protected thisIsProtected = 1; private thisIsPrivate = 1; bar():Foo { const that = this; return new class extends Foo { something() { return that.thisIsPrivate + that.thisIsProtected; } } } }
I get a compile error for that.thisIsProtected, but not for that.thisIsPrivate
that.thisIsProtected
that.thisIsPrivate
I can access the protected field, like the private
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
π Search Terms
private, protected
π Version & Regression Information
Version 5.6.2
β― Playground Link
https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAYwDYEMDOa4DEITgbwChC5S4woIZgFqATOGACwEs0BJNABUutuAYBeOAEYA3CTIUWANxTVGrDtyiz5wOMPHEycAEYooACgCUALhx4iu3QggA7NPGbzNithJtlJXqMBgArlD2cPbAAO6IqBhwoNT2dJiWBDpeNmgQALb+rPYA5qYpacVwfoHBivIAdMxsnDxqCgDUlTA1SvW8NPSeJaQAvj42g7qD-UA
π» Code
π Actual behavior
I get a compile error for
that.thisIsProtected
, but not forthat.thisIsPrivate
π Expected behavior
I can access the protected field, like the private
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: