www.digitalmars.com         C & C++   DMDScript  

D.gnu - [bug] static parent function

reply "Carlos Santander B." <csantander619 gmail.com> writes:
gdc fails to compile this:

//-----------------------------------
class A
{
         static int foo() { return 0; }
}

class B:A
{
         void bar() { A.foo(); }   //fail.d:8
}
//-----------------------------------

$ gdc -c fail.d
fail.d:8: cannot use "this.A" as an expression

DMD 0.113 can compile it.
Using gdc 0.10 on cygwin (gcc 3.4.1)

_______________________
Carlos Santander Bernal
Feb 15 2005
parent =?UTF-8?B?VGhvbWFzIEvDvGhuZQ==?= writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carlos Santander B. wrote:

| gdc fails to compile this:
|
| //-----------------------------------
| class A
| {
|         static int foo() { return 0; }
| }
|
| class B:A
| {
|         void bar() { A.foo(); }   //fail.d:8
| }
| //-----------------------------------
|
| $ gdc -c fail.d
| fail.d:8: cannot use "this.A" as an expression
|
| DMD 0.113 can compile it.
| Using gdc 0.10 on cygwin (gcc 3.4.1)

Added to DStress as
http://dstress.kuehne.cn/run/static_29.d

Thomas

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)

iD8DBQFCFmpQ3w+/yD4P9tIRAqbUAJ9iySGW0s3u+W8AdSZvRLsZegZ+9gCgz2Yc
ykzFsNeF0PbFdr/6A2M9BI8=
=J/s6
-----END PGP SIGNATURE-----
Feb 18 2005