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: 3.1.0-dev.20180809
Code
class A { private n!: number; } const a = new A(); const nameN = "n"; const n = a[nameN];
Expected behavior:
Error at a[nameN] just like for a.n.
a[nameN]
a.n
Actual behavior:
No error.
The text was updated successfully, but these errors were encountered:
This is an intended allowed bypass; see https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#413-property-access which outlines accessibility rules for a.x but not a["x"]
a.x
a["x"]
Sorry, something went wrong.
I wrote a linter rule to check accessibility of element access the same way TypeScript checks property access: no-restricted-property-access For a description on how to use it, see https://github.com/fimbullinter/wotan/blob/master/packages/wotan/README.md
No branches or pull requests
TypeScript Version: 3.1.0-dev.20180809
Code
Expected behavior:
Error at
a[nameN]
just like fora.n
.Actual behavior:
No error.
The text was updated successfully, but these errors were encountered: