mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01: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
-1
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
fn main() -> Int {
|
||||
var (.x = Int, .y = Int): t2 = (.y = 5, .x = 2);
|
||||
var (.x = Int, .y = Int): t2 = (.x = 2, .y = 5);
|
||||
t2.y = 3;
|
||||
return t2.y - t2.x - 1; // 3 - 2 - 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user