Bug 19954 – ICE: Casting AliasSeq to array and passing to a function

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-06-12T11:18:03Z
Last change time
2020-03-21T03:56:35Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Wolfgang

Comments

Comment #0 by an.address — 2019-06-12T11:18:03Z
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")); }
Comment #1 by b2.temp — 2019-06-12T12:14:48Z
And it's a regression too : https://run.dlang.io/is/HlFXXK
Comment #2 by simen.kjaras — 2019-06-12T22:12:09Z
Reduced example: void fun(string[]){} unittest { import std.meta : AliasSeq; fun(cast(string[])AliasSeq!""); }
Comment #3 by b2.temp — 2019-06-13T00:40:17Z
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
Comment #4 by dlang-bot — 2019-06-14T13:48:37Z
@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
Comment #5 by dlang-bot — 2019-06-15T07:40:51Z
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