I don't know how to describe the error, but here is some reduced code that provokes the error in DMD 2.061:
--- Vector.d ---
import Rotate;
import Scale;
struct SVector(T)
{
this(T) {}
ref opOpAssign(string op)(T) {}
ref opOpAssign(string op)(SScale!T) {}
void foo() { this *= 1.0; }
}
struct SNormal(T)
{
this(SVector!T) { SVector!T().foo; }
}
--- Scale.d ---
import Vector;
struct SScale(T)
{
auto aaa = SVector!T(1.0);
}
--- Rotate.d ---
import Vector;
struct SRotate(T)
{
this()(int) {}
this()(char)
{
SRotate!T(0);
SNormal!T aaa = SVector!T();
}
}
auto bbb = SRotate!(float)('A');
----------------
Compiled with "dmd Vector.d"
Comment #1 by callumenator — 2013-03-03T16:51:45Z
Another trigger, DMD 2.062:
import std.traits, std.typecons;
void bug(E)(lazy E expr)
{
alias ReturnType!expr RT;
}
void main()
{
bug(RefCounted!int(0));
}
Comment #2 by clugdbug — 2013-04-08T02:56:45Z
The original test case works for me in 2.062.
Reduced test case for comment 1:
template c9445(T...)
{
static assert(is(typeof( & T[0].xxx )));
}
void bug9445(void delegate() expr)
{
static assert( c9445!( expr() ) );
}
Comment #3 by github-bugzilla — 2013-04-08T05:19:05Z