Bug 6304 – DMD does not recognize size_t parameter type while type matching
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2011-07-12T18:21:00Z
Last change time
2011-07-12T18:25:35Z
Assigned to
nobody
Creator
puneet
Comments
Comment #0 by puneet — 2011-07-12T18:21:28Z
Here is a small test case. I get this error on dmd 2.054/053/052/051.
Error vanishes if I replace size_t with ulong on line 6 (inside the is expression).
$ dmd struct.d
Error: undefined identifier size_t
struct.d(11): Error: template instance struct.printFoo!(Foo!(Bar,1)) error instantiating
// struct.d
import std.stdio;
struct Foo(IF, size_t N) {}
interface Bar {}
void printFoo(T)(T foo) {
static if(is(T L: Foo!(IF, N), IF, size_t N)) {
writeln("Type: ", T.stringof);
}
}
void main() {
Foo!(Bar, 1) foo;
printFoo(foo);
}
Comment #1 by yebblies — 2011-07-12T18:25:35Z
*** This issue has been marked as a duplicate of issue 2355 ***