π Search Terms
using destructure
π Version & Regression Information
- I was unable to test this on prior versions because this is a new feature in 5.2
β― Playground Link
https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABAcwKZQEqoM5xAJwlQAoBKRAbwChFbF90Clq7XFg44AuRAIgCMAhvl4AaGm1oBtAMoBPALb84AGwB0AExjYADnGyoAujzKIAvAD5KAX3GtrVB1RZ0Q2GGGT1zKdFlwERGQA3BK0EAi4KqhqKnDIxPhqHHCkoU7OYYhuHl4U7JyI1j5omDh4hCRpWRFgUTFxCSnV1kA
π» Code
functiongetResource(){return{foo: "bar",[Symbol.dispose]: ()=>{},}}{
using { foo }=getResource();console.log(foo);}```### π Actual behavior> Error: 'using' declarations may not have binding patterns.(1492)### π Expected behaviorShould be able to destructure a variable defined using the `using` keyword
### Additionalinformationabouttheissue_Noresponse_
π Search Terms
using destructure
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABAcwKZQEqoM5xAJwlQAoBKRAbwChFbF90Clq7XFg44AuRAIgCMAhvl4AaGm1oBtAMoBPALb84AGwB0AExjYADnGyoAujzKIAvAD5KAX3GtrVB1RZ0Q2GGGT1zKdFlwERGQA3BK0EAi4KqhqKnDIxPhqHHCkoU7OYYhuHl4U7JyI1j5omDh4hCRpWRFgUTFxCSnV1kA
π» Code