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 #6571 from yazd/issue16083
Fix issue 16083 - AliasSeq loses type of enums that have the same value
- Loading branch information
Showing
2 changed files
with
21 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,15 @@ | ||
template Alias(Stuff...) | ||
{ | ||
alias Alias = Stuff; | ||
} | ||
|
||
enum A { a = 0 } | ||
enum B { b = 0 } | ||
|
||
enum C { c = "abc" } | ||
enum D { d = "abc" } | ||
|
||
static assert(is(typeof(Alias!(A.a)[0]) == A)); | ||
static assert(is(typeof(Alias!(B.b)[0]) == B)); | ||
static assert(is(typeof(Alias!(C.c)[0]) == C)); | ||
static assert(is(typeof(Alias!(D.d)[0]) == D)); |