Skip to content

Commit 790178f

Browse files
committed
reference.md: clarify the limitation of type alias on an enum
Cf. #26264 Signed-off-by: NODA, Kai <[email protected]>
1 parent 388ccda commit 790178f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/doc/reference.md

+10
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,16 @@ type Point = (u8, u8);
11181118
let p: Point = (41, 68);
11191119
```
11201120

1121+
Currently a type alias to an enum type cannot be used to qualify the
1122+
constructors:
1123+
1124+
```
1125+
enum E { A }
1126+
type F = E;
1127+
let _: F = E::A; // OK
1128+
// let _: F = F::A; // Doesn't work
1129+
```
1130+
11211131
### Structs
11221132

11231133
A _struct_ is a nominal [struct type](#struct-types) defined with the

0 commit comments

Comments
 (0)