Reduced test case:
const C = 1;
struct E ( ubyte G )
{
}
alias E!(C) I;
struct J
{
}
class L
{
struct M ( N... )
{
union { N P; }
Q R ( Q ) ()
{
foreach ( U ; P )
return U;
assert(0);
}
}
class X
{
bool delegate ( ) AB;
}
class BB ( M, I, CB, DB ) : X
{
void FB ( )
{
this.AB = &this.outer.IB!(I, CB);
}
}
bool IB ( I, CB ) ( )
{
auto KB = &(cast(CB)this).MB!(I);
return false;
}
alias M!(I) OB;
BB!(OB, I, typeof(this), J) QB;
void MB (RB) ( )
{
auto SB = cast(OB*) null;
SB.R!(RB);
}
}
$ dmd1 -inline ./result.d
Internal error: backend/cod1.c 1708
Comment #1 by bugzilla — 2014-10-12T20:42:16Z
This one works on D2.
Comment #2 by bugzilla — 2014-10-12T21:06:56Z
Reduced test case:
struct E { }
struct M ( N... )
{
struct { N P; }
E R()
{
foreach ( U ; P )
return U;
assert(0);
}
}
void MB( )
{
auto SB = cast(M!(E)*) null;
SB.R();
}
Comment #3 by bugzilla — 2014-10-12T22:03:55Z
Workaround, in case it is blocking anyone:
(In reply to Walter Bright from comment #2)
> E R()
> {
> foreach ( U ; P )
> return U;
> assert(0);
return E(); // add this line
> }
> }
Comment #4 by github-bugzilla — 2014-10-13T04:40:34Z