Bug 13356 – [ICE] (dmd 2.066: statement.c:754) with recursive Algebraic
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-08-22T12:09:00Z
Last change time
2015-02-18T03:37:41Z
Keywords
ice, pull
Assigned to
nobody
Creator
philippe.sigaud
Comments
Comment #0 by philippe.sigaud — 2014-08-22T12:09:15Z
This creates an [ICE] (2.066):
struct List {
import std.variant : Algebraic;
import std.typecons : Tuple;
alias Payload = Algebraic!(
double,
Tuple!(List)
);
Payload payload;
this(double d) { payload = Payload(d); }
}
void main() {
}
Error message:
dmd: statement.c:754: ErrorStatement::ErrorStatement(): Assertion `global.gaggedErrors || global.errors' failed.
Using Algebraic!(double, List) or using a class instead of a struct makes the ICE disappear (there are other errors, though).
Comment #1 by john.loughran.colvin — 2014-09-30T10:10:04Z
Another test case:
void writeConfig()
{
JSONValue v;
v["name"] = .z();
}
struct JSONValue
{
import std.variant;
alias Payload = Algebraic!(typeof(null));
Payload payload;
alias payload this;
}
Comment #2 by k.hara.pg — 2014-10-01T12:56:32Z
(In reply to Philippe Sigaud from comment #0)
> This creates an [ICE] (2.066):
>
[snip]
Compiler fix:
https://github.com/D-Programming-Language/dmd/pull/4036
(In reply to John Colvin from comment #1)
> Another test case:
>
[snip]
The root problem of the second case was bit different from the first case, so I separated it into issue 13563.
Comment #3 by github-bugzilla — 2014-10-05T07:07:45Z