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.0.3 3.1.0-dev.20180829
Search Terms: private fields destructuring private members destructuring
Code
class Foo { private prop; } const foo = new Foo(); const bar = { foo }; // Errors foo.prop; const { prop: prop1 } = foo; // No error const { foo: { prop: prop2 } } = bar;
Expected behavior: Nested destructuring of private and protected members causes an error
Actual behavior: It doesn't
Playground Link: https://www.typescriptlang.org/play/index.html#src=class%20Foo%20%7B%0D%0A%20%20%20%20private%20prop%3B%0D%0A%7D%0D%0Aconst%20foo%20%3D%20new%20Foo()%3B%0D%0Aconst%20bar%20%3D%20%7B%20foo%20%7D%3B%0D%0A%0D%0A%2F%2F%20Errors%0D%0Afoo.prop%3B%0D%0Aconst%20%7B%20prop%3A%20prop1%20%7D%20%3D%20foo%3B%20%0D%0A%0D%0A%2F%2F%20No%20error%0D%0Aconst%20%7B%20foo%3A%20%7B%20prop%3A%20prop2%20%7D%20%7D%20%3D%20bar%3B%0D%0A%20
Related Issues: #7124
The text was updated successfully, but these errors were encountered:
Seems fixed now. Probably by #28562.
Sorry, something went wrong.
rbuckton
No branches or pull requests
TypeScript Version:
3.0.3
3.1.0-dev.20180829
Search Terms:
private fields destructuring
private members destructuring
Code
Expected behavior:
Nested destructuring of private and protected members causes an error
Actual behavior:
It doesn't
Playground Link:
https://www.typescriptlang.org/play/index.html#src=class%20Foo%20%7B%0D%0A%20%20%20%20private%20prop%3B%0D%0A%7D%0D%0Aconst%20foo%20%3D%20new%20Foo()%3B%0D%0Aconst%20bar%20%3D%20%7B%20foo%20%7D%3B%0D%0A%0D%0A%2F%2F%20Errors%0D%0Afoo.prop%3B%0D%0Aconst%20%7B%20prop%3A%20prop1%20%7D%20%3D%20foo%3B%20%0D%0A%0D%0A%2F%2F%20No%20error%0D%0Aconst%20%7B%20foo%3A%20%7B%20prop%3A%20prop2%20%7D%20%7D%20%3D%20bar%3B%0D%0A%20
Related Issues:
#7124
The text was updated successfully, but these errors were encountered: