mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-25 11:32:37 +00:00
Tuple restrictions (#486)
* implement tuple restrictions: (1) named fields after positional, (2) order matters * after_named_member => seen_named_member
This commit is contained in:
1 parent
8b78a85276
commit
5946d9c033
17 files changed
+98
-26
No files matched your search
+1
-1
@@ -5,7 +5,7 @@
|
||||
// Test matching with a mixture of positional and named fields.
|
||||
|
||||
fn main() -> Int {
|
||||
var auto: t = (.x = 5, 2);
|
||||
var auto: t = (2, .x = 5);
|
||||
match (t) {
|
||||
case (auto: a, .x = auto: b) =>
|
||||
return a - b + 3;
|
||||
|
||||
Reference in new issue
Block a user