mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:10:14 +01:00
Fix x/_ and y/z in faq example. (#2230)
This commit is contained in:
+2
-2
@@ -366,14 +366,14 @@ variable binding. For example:
|
||||
var ((x: i32, _: i32), y: auto) = ((1, 2), (3, 4));
|
||||
```
|
||||
|
||||
This code is valid, and initializes `x` to `1` and `z` to `(3, 4)`. In the
|
||||
This code is valid, and initializes `x` to `1` and `y` to `(3, 4)`. In the
|
||||
future, we will probably also support destructuring structs in a similar way,
|
||||
and many other kinds of patterns are possible.
|
||||
|
||||
Now consider how that example would look if the `var` token were not required:
|
||||
|
||||
```
|
||||
((_: i32, x: i32), y: auto) = ((1, 2), (3, 4));
|
||||
((x: i32, _: i32), y: auto) = ((1, 2), (3, 4));
|
||||
```
|
||||
|
||||
With this example, the parser would need to look four tokens ahead to determine
|
||||
|
||||
Reference in New Issue
Block a user