recursive alias declaration
Namespace
rswhite4 at googlemail.com
Tue Jul 23 10:00:31 PDT 2013
Did I miss something or is this a bug?
----
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*
overlap' to 'Rect!short' or 'Rect!T' everything works fine.
More information about the Digitalmars-d-learn
mailing list