----
import std.stdio;
struct Rect(T) {
public:
bool intersects(ref const Rect!T rhs, ShortRect* overlap = null)
{
return false;
}
}
alias FloatRect = Rect!float;
alias ShortRect = Rect!short;
void main() {
}
----
print:
tpl_bug.d(11): Error: alias tpl_bug.ShortRect recursive alias
declaration
tpl_bug.d(11): Error: template instance tpl_bug.Rect!(short)
error instantiating
tpl_bug.d(10): Error: template instance tpl_bug.Rect!(float)
error instantiating
dmd 2.063.2, Windows
Seems the Compiler is a bit confused. If I change 'ShortRect' to 'Rect!short' or 'Rect!T' everything works fine.
Comment #1 by Jesse.K.Phillips+D — 2014-06-25T03:26:37Z
Before the compiler can define what ShortRect is it must first create a Rect!short, to create a Rect!short it needs to know what a ShortRect is.
This might be more of an enhancement than bug.
Comment #2 by dlang-bugzilla — 2017-07-03T17:07:16Z