D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19954 - ICE: Casting AliasSeq to array and passing to a function
Summary: ICE: Casting AliasSeq to array and passing to a function
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2019-06-12 11:18 UTC by Wolfgang
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Wolfgang 2019-06-12 11:18:03 UTC
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 basile-z 2019-06-12 12:14:48 UTC
And it's a regression too : https://run.dlang.io/is/HlFXXK
Comment 2 Simen Kjaeraas 2019-06-12 22:12:09 UTC
Reduced example:

void fun(string[]){}

unittest {
    import std.meta : AliasSeq;
    fun(cast(string[])AliasSeq!"");
}
Comment 3 basile-z 2019-06-13 00:40:17 UTC
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 Dlang Bot 2019-06-14 13:48:37 UTC
@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 Dlang Bot 2019-06-15 07:40:51 UTC
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