digitalmars.D.bugs - Generic Inner Class Inheritance
- Garett Bass (25/25) Nov 02 2005 Under DMD 0.136 and 0.137, generic inner classes cannot
- Walter Bright (1/1) Nov 05 2005 Looks like a compiler bug.
- Thomas Kuehne (12/35) Nov 06 2005 -----BEGIN PGP SIGNED MESSAGE-----
Under DMD 0.136 and 0.137, generic inner classes cannot
inherit from abstract inner classes. Is this the intended
behavior?
class Outer {
int x;
abstract class AbstractInner {
void f();
}
class GenericInner(T) : AbstractInner {
T t;
void f() { writefln("GenericInner.f()"); x = 2; }
}
class ConcreteInner : AbstractInner {
void f() { writefln("ConcreteInner.f()"); x = 2; }
}
this() {
auto AbstractInner g = new GenericInner!(int)(); // Error
auto AbstractInner c = new ConcreteInner(); // Ok
}
}
Error message: "class main.Outer.GenericInner!(int).GenericInner
super class Abstract Inner is nested within Outer, not
GenericInner!(int)
Regards,
Garett
Nov 02 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Garett Bass schrieb am 2005-11-02:
Under DMD 0.136 and 0.137, generic inner classes cannot
inherit from abstract inner classes. Is this the intended
behavior?
class Outer {
int x;
abstract class AbstractInner {
void f();
}
class GenericInner(T) : AbstractInner {
T t;
void f() { writefln("GenericInner.f()"); x = 2; }
}
class ConcreteInner : AbstractInner {
void f() { writefln("ConcreteInner.f()"); x = 2; }
}
this() {
auto AbstractInner g = new GenericInner!(int)(); // Error
auto AbstractInner c = new ConcreteInner(); // Ok
}
}
Error message: "class main.Outer.GenericInner!(int).GenericInner
super class Abstract Inner is nested within Outer, not
GenericInner!(int)
Added to DStress as
http://dstress.kuehne.cn/run/t/template_class_12_A.d
http://dstress.kuehne.cn/run/t/template_class_12_B.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFDbtPL3w+/yD4P9tIRApD1AKCvro6C2VQ/16RWxjCl5NHWfxmBfwCfav5E
eAKrFR9R9nMM/8TF3T+/p5Y=
=QaY2
-----END PGP SIGNATURE-----
Nov 06 2005









"Walter Bright" <newshound digitalmars.com> 