This is an internal compiler error; it deserves some attention.
Also, confirmed that it still happens in latest git dmd.
Comment #2 by clugdbug — 2012-11-26T07:44:06Z
Very marginally simplified. If you take out the "if (func.length == 1)" then it segfaults instead.
-------------
template ReturnType(func...) if (func.length == 1) { }
struct MyClass {
auto xopBinary(T)() { }
}
struct BinaryOperatorX() {
ReturnType!(mixin("MyClass.xopBinary!(int)")) RET_T;
}
void PydMain() {
BinaryOperatorX!();
}
Comment #3 by clugdbug — 2012-11-28T00:51:37Z
Further reduced.
------------------
template T8602(func...) if (func.length == 1) { }
struct Bug8602 {
auto xx() { }
}
T8602!(mixin("Bug8602.xx")) mm;
Comment #4 by clugdbug — 2012-11-28T00:53:41Z
The problem is that at the end of CompileExp::semantic, the result is xx, but the type of xx is still not known because it was a return-type inferred function.
Comment #5 by andrej.mitrovich — 2013-02-04T13:45:19Z
(In reply to comment #3)
> Further reduced.
> ------------------
> template T8602(func...) if (func.length == 1) { }
>
> struct Bug8602 {
> auto xx() { }
> }
>
> T8602!(mixin("Bug8602.xx")) mm;
The ICE is gone in git-head, now only gives:
Error: T8602!(xx) is used as a type
Comment #6 by k.hara.pg — 2013-02-05T21:05:08Z
(In reply to comment #5)
> (In reply to comment #3)
> > Further reduced.
> > ------------------
> > template T8602(func...) if (func.length == 1) { }
> >
> > struct Bug8602 {
> > auto xx() { }
> > }
> >
> > T8602!(mixin("Bug8602.xx")) mm;
>
> The ICE is gone in git-head, now only gives:
>
> Error: T8602!(xx) is used as a type
This is correct behavior, because T8602!(Bug8602.xx) does not make a type.
Maybe this is a dup of bug 5933.