IssueRaiser

Parameter destructuring

Looked for an issue on this, but did not find one. This was briefly mentioned in #2774: > This is not about patterns in parameters, which we should also have In Rust, you can do: ```rust struct Abc { i: i32, } fn example(Abc{i}: Abc) -> i32 { i } fn example2((a, b): (i32, i32)) {} ``` This sort of syntax would be very nice to have in Dart, like: ```dart class Abc { int i; } int example(Abc(i)) => i; void example2((int a, int b)) {}; example(Abc(1234)); example2((1, 2)); ```

Posted by GregoryConrad on Apr 17, 2023, 12:03 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

github (Other)

Parameter destructuring

GregoryConradApr 17, 2023, 12:03 AM

Looked for an issue on this, but did not find one. This was briefly mentioned in #2774: > This is not about patterns in parameters, which we should also have In Rust, you can do: ```rust struct Abc { i: i32, } fn example(Abc{i}: Abc) -> i32 { i } fn example2((a, b): (i32, i32)) {} ``` This sort of syntax would be very nice to have in Dart, like: ```dart class Abc { int i; } int example(Abc(i)) => i; void example2((int a, int b)) {}; example(Abc(1234)); example2((1, 2)); ```

Comments (0)

No comments yet. Start the discussion.

Comment on this issue