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 #3733 from 9rnsr/fix13024
[REG2.066a] Issue 13024 - [ICE](expression.c line 1172) with implicit supertype conversion of different enums in array literal
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/ice13024.d(15): Error: cannot implicitly convert expression (t.x) of type A to B | ||
--- | ||
*/ | ||
|
||
enum A { a } | ||
enum B { b } | ||
struct T { A x; B y; } | ||
void main() | ||
{ | ||
T t; | ||
auto r1 = [cast(int)(t.x), cast(int)(t.y)]; // OK | ||
auto r3 = [t.x, t.y]; // crash | ||
} |