digitalmars.D.bugs - [Issue 419] New: Anonymous classes are not working.
- d-bugmail puremagic.com (44/44) Oct 09 2006 http://d.puremagic.com/issues/show_bug.cgi?id=419
- d-bugmail puremagic.com (9/9) Oct 18 2006 http://d.puremagic.com/issues/show_bug.cgi?id=419
- Thomas Kuehne (14/31) Oct 21 2006 -----BEGIN PGP SIGNED MESSAGE-----
http://d.puremagic.com/issues/show_bug.cgi?id=419
Summary: Anonymous classes are not working.
Product: D
Version: 0.169
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla digitalmars.com
ReportedBy: benoit tionex.de
interface I {
void get( char[] s );
}
class C{
void init(){
I i = new class() I {
void get( char[] s ){
func(); // line 8
}
};
}
void func( ){ }
}
void main(){
}
an.d(8): this for func needs to be type C not type void*
See also: http://www.digitalmars.com/d/class.html#anonymous
Doing that line
I i = new class() { // without the "I"
gives this nice message:
an.d(8): this for func needs to be type C not type void*
an.d(6): cannot implicitly convert expression ((class __anonclass1 : Object
{
void get(char[] s)
{
assert(this,"null this");
((this.this).func)();
}
void* this;
}
) , new __anonclass1) of type an.C.init.__anonclass1 to an.I
--
Oct 09 2006
http://d.puremagic.com/issues/show_bug.cgi?id=419
bugzilla digitalmars.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Fixed DMD 0.170
--
Oct 18 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 d-bugmail puremagic.com schrieb am 2006-10-09:http://d.puremagic.com/issues/show_bug.cgi?id=419interface I { void get( char[] s ); } class C{ void init(){ I i = new class() I { void get( char[] s ){ func(); // line 8 } }; } void func( ){ } } void main(){ } an.d(8): this for func needs to be type C not type void*<snip> Added to DStress as http://dstress.kuehne.cn/run/t/this_13_A.d http://dstress.kuehne.cn/run/t/this_13_B.d http://dstress.kuehne.cn/run/t/this_13_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFOilNLK5blCcjpWoRAlSHAJ9JX/gND++RZtDGNNHFr19Cspo89ACfUAN1 wihuTFjMM92bs4sN6xviX50= =VZf2 -----END PGP SIGNATURE-----
Oct 21 2006









d-bugmail puremagic.com 