File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 5
5
Summary
6
6
=======
7
7
8
- Add simple syntax for accessing values within tuples and tuple structs.
8
+ Add simple syntax for accessing values within tuples and tuple structs behind a
9
+ feature gate.
9
10
10
11
Motivation
11
12
==========
@@ -26,11 +27,12 @@ Detailed design
26
27
===============
27
28
28
29
Add syntax of the form ` <expr>.<integer> ` for accessing values within tuples and
29
- tuple structs. This syntax is recognised wherever an unsuffixed integer or
30
- float literal is found in place of the normal field or method name expected when
31
- accessing fields with ` . ` . Float literals in this position are expanded into two
32
- field accesses, so that an expression of the form ` a.1.3 ` is equivalent to
33
- ` (a.1).3 ` .
30
+ tuple structs. This (and the functionality it provides) would only be allowed
31
+ when the feature gate ` tuple_indexing ` is enabled. This syntax is recognised
32
+ wherever an unsuffixed integer literal is found in place of the normal field or
33
+ method name expected when accessing fields with ` . ` . Because the parser would be
34
+ expecting an integer, not a float, an expression like ` expr.0.1 ` would be a
35
+ syntax error (because ` 0.1 ` would be treated as a single token).
34
36
35
37
Tuple/tuple struct field access behaves the same way as accessing named fields
36
38
on normal structs:
You can’t perform that action at this time.
0 commit comments