digitalmars.D.bugs - DMD 0.95: Anonymous functions are only instantiated once in mixins.
- Burton Radons (21/21) Jul 17 2004 This code fails with the errors:
This code fails with the errors:
foo.d(5): function call (void(*value)(char[]v)) does not match
argument types (v
oid(*)(int v))
foo.d(5): cannot implicitly convert void(*)(int v) to void(*)(char[]v)
It should compile correctly; the anonymous function in foo.func is not
being instantiated for each mixin. This is the code:
template foo (type)
{
void func ()
{
call (function void (type v) { });
}
}
struct tvec (type)
{
mixin foo! (type);
void call (void function (type v) value) { }
}
tvec! (int) a;
tvec! (char []) b;
Jul 17 2004








Burton Radons <burton-radons shaw.ca>