[Issue 22662] New: ICE caused by forward reference
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jan 10 03:06:04 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22662
Issue ID: 22662
Summary: ICE caused by forward reference
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.098.1, the following program fails to compile:
---
enum isHashable(T) = __traits(compiles, T.init.tupleof[0][0].sizeof);
struct SumType(Types...)
{
union Storage
{
Types values;
}
Storage storage;
static if (isHashable!(Types[0])) {}
}
string[] toLines(Expression val) {
return [];
}
alias Expression = SumType!(Scope, Return);
struct Return {
Expression* _expr = new Expression;
}
struct Scope {
Expression[] statements;
string[] toLines() {
return Expression.init.toLines;
}
}
---
When attempting to compile, DMD gives the following output:
---
Error: unknown, please file report on issues.dlang.org
---
Any further reduction of the example program either causes compilation to
succeed, or results in a different error.
--
More information about the Digitalmars-d-bugs
mailing list