Skip to content

Commit d46a510

Browse files
authored
Fix Issue 21178 - It is not explained what is "unknown" (#3512)
* Fix Issue 21178 * Fix Issue 21178 - It is not explained what is "unknown" I showcased what does the term opaque mean by trying to access it's "initializer". This results in an error.
1 parent b14afad commit d46a510

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spec/enum.dd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ enum E : C
123123
---
124124
)
125125

126-
$(P An empty enum body (For example $(CODE enum E;)) signifies an opaque
127-
enum - the enum members are unknown.)
126+
$(P An empty enum body signifies an opaque enum - the enum members are unknown.)
127+
---
128+
enum X; // opaque enum
129+
writeln(X.init); // error: enum X is opaque and has no default initializer
130+
---
128131

129132
$(H3 $(LNAME2 enum_default_initializer, Enum Default Initializer))
130133

0 commit comments

Comments
 (0)