DMD64 D Compiler v2.086.0 Fedora Linux 5.1.5-300.fc30.x86_64 x86_64 Compiling this code causes dmd to crash, saying "Illegal instruction": enum String { STRING = "string", } void main() { import std.algorithm; import std.traits; assert((cast(string[])(EnumMembers!String)).canFind("none")); }
And it's a regression too : https://run.dlang.io/is/HlFXXK
Reduced example: void fun(string[]){} unittest { import std.meta : AliasSeq; fun(cast(string[])AliasSeq!""); }
even more: --- void main() { auto a = cast(char[][]) ""; } --- Attempt to fix leads to a past problem with CTFE : https://github.com/dlang/dmd/pull/9516#issuecomment-478227203
@JinShil updated dlang/dmd pull request #10036 "Fix Issue 19954 - ICE: Casting AliasSeq to array and passing to a function" fixing this issue: - Fix Issue 19954 - ICE: Casting AliasSeq to array and passing to a function https://github.com/dlang/dmd/pull/10036
dlang/dmd pull request #10036 "Fix Issue 19954 - ICE: Casting AliasSeq to array and passing to a function" was merged into stable: - 4c7f98dd90fafd282a5eff1d59ff474a74ec2d23 by JinShil: Fix Issue 19954 - ICE: Casting AliasSeq to array and passing to a function https://github.com/dlang/dmd/pull/10036