<!-- Thanks for submitting an issue to AssemblyScript! Please take a moment to read the contributing guidelines linked below to get off to a good start 🙂 --> [enhancement] Currently, it seems that destructuring is not supported. It is one of my most used TS features, and I'd like to see it in AssemblyScript. There are many subtleties to destructuring, but the original TS repo has a well-documented history of changes: https://github.com/microsoft/TypeScript/pull/1346 https://github.com/microsoft/TypeScript/pull/1463 We would ideally support ```typescript var [x, y] = [10, 20]; [x, y] = [y, x]; // and interface Foo { bar: f32, baz: f32 }; const { bar } = Foo; // and class Foo { bar: f32 = 10.0 }; const { bar } = new Foo(); ````
Activity
MaxGraey commentedon Sep 25, 2020
@dcodeIO I know in general case it required iterators, but most of time it will be optimized to simple stuffs. For example:
desugared to:
playground
And I guess it already could be implemented with some limitations
ExE-Boss commentedon Mar 31, 2021
@MaxGraey That’s only if you don’t enable the
downlevelIterationoption.