[Issue 570] New: Bogus recursive mixin error
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Nov 18 19:06:54 PST 2006
http://d.puremagic.com/issues/show_bug.cgi?id=570
Summary: Bogus recursive mixin error
Product: D
Version: 0.174
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: rejects-valid
Severity: major
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: daekharel at gmail.com
import std.stdio;
template TupleDecls(T, R ...) {
T value;
static if (R.length)
mixin TupleDecls!(R) Inner;
}
struct TupleStruct(T ...) { mixin TupleDecls!(T); }
void main() {
alias TupleStruct!(char[], char[]) twoStrings;
}
---------
The above code generates the following errors when compiling:
err.d(6): mixin
err.TupleStruct!(char[],char[]).TupleStruct.TupleDecls!(char[],char[]).TupleDecls!(char[])
recursive mixin instantiation
err.d(12): template instance err.TupleStruct!(char[],char[]) error
instantiating
The compiler seems to think that TupleDecls!(char[]) is the same as
TupleDecls!(char[], char[]) somehow, and rejects instantiating the former
inside the latter as being recursive, even though it's not.
--
More information about the Digitalmars-d-bugs
mailing list