Skip to content

Commit 36cf612

Browse files
committed
Fix p1
1 parent 62a48a5 commit 36cf612

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* TEST_OUTPUT:
2+
---
3+
fail_compilation/enum_base_type.d(16): Error: enum member `enum_base_type.A2.d` value cannot be automatically defined because the base type `A1` does not support increment
4+
---
5+
*/
6+
7+
enum A1 : int
8+
{
9+
a,
10+
b,
11+
}
12+
13+
enum A2 : A1
14+
{
15+
c = A1.a, // explicitly set value OK
16+
d, // error: cannot auto-increment enum type
17+
}

0 commit comments

Comments
 (0)