Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3779 from 9rnsr/fix13142
Issue 13142 - Enums on different classes confuse the compiler
- Loading branch information
1 parent
cad191c
commit 5b9f27c
Showing
3 changed files
with
43 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/diag13142.d(25): Error: cannot implicitly convert expression (3) of type int to TYPE | ||
--- | ||
*/ | ||
|
||
class Button | ||
{ | ||
enum TYPE // button type | ||
{ | ||
COMMAND, | ||
CHECK, | ||
OPTION, | ||
} | ||
} | ||
|
||
class Toolbar | ||
{ | ||
enum ButtonTYPE // button type | ||
{ | ||
COMMAND = Button.TYPE.COMMAND, | ||
CHECK = Button.TYPE.CHECK, | ||
OPTION = Button.TYPE.OPTION, | ||
DELIMETER = Button.TYPE.max + 1 | ||
} | ||
} |