D - template error
- Paul Runde (33/33) Aug 01 2003 //test.d
- Walter (1/1) Aug 02 2003 Thanks, I can take it from here. -Walter
//test.d
struct block
{
int x;
int y;
int x1;
int x2;
}
typedef block lblock;
template vector(T)
{
T buf;
T get()
{
return buf;
}
}
instance vector(lblock) foo;
int main(char[][] args)
{
lblock b = foo.get();
return 0;
}
/*
This code will not compile -- Internal error: ..\ztc\cod1.c 1637
It will compile if I make foo an instance of vector(block) instead
of lblock.
OR
It will compile if x1 and x2 in block are commented out.
I know the code won't run if compiled -- I pruned off everything I
didn't need to reproduce the error.
*/
Paul
Aug 01 2003








"Walter" <walter digitalmars.com>