digitalmars.D - static and non-static methods with same name
- Kris (7/7) Apr 08 2005 class Foo
- Thomas Kuehne (14/21) Apr 08 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Sean Kelly (3/10) Apr 09 2005 FWIW, I can't reproduce this with DMD .120.
- Kris (6/19) Apr 09 2005 Thanks, Sean. Was this one fixed in v119? I see something similar noted
- Stewart Gordon (9/22) Apr 12 2005 The fix of this bug _was_ documented in the changelog. But it's vanishe...
- Walter (16/23) Apr 09 2005 The following compiles and runs fine:
- Kris (5/30) Apr 09 2005 Thanks; the issue was resolved via the fixes in v119 (which couldn't be ...
- xs0 (20/54) May 12 2005 I get this with 0.123:
- Thomas Kuehne (13/30) May 13 2005 -----BEGIN PGP SIGNED MESSAGE-----
class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.
Apr 08 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kris schrieb am Fri, 8 Apr 2005 22:33:28 -0700:class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.Added to DStress as http://dstress.kuehne.cn/run/overload_19.d http://dstress.kuehne.cn/run/overload_20.d http://dstress.kuehne.cn/run/overload_21.d http://dstress.kuehne.cn/run/overload_22.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCV3Ox3w+/yD4P9tIRArn7AJ9jUa9RLXf4pmQfgXErhi+me/+hUgCgpTBD 4YwFyD9Kgv8m9ID5YtTnngI= =vQse -----END PGP SIGNATURE-----
Apr 08 2005
In article <d37pf8$17b3$2 digitaldaemon.com>, Kris says...class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.FWIW, I can't reproduce this with DMD .120. Sean
Apr 09 2005
Thanks, Sean. Was this one fixed in v119? I see something similar noted there. (couldn't use that version, given the "base class forward reference" issue, and couldn't download v120) "Sean Kelly" <sean f4.ca> wrote in message news:d392i3$164f$1 digitaldaemon.com...In article <d37pf8$17b3$2 digitaldaemon.com>, Kris says...class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.FWIW, I can't reproduce this with DMD .120. Sean
Apr 09 2005
Sean Kelly wrote:In article <d37pf8$17b3$2 digitaldaemon.com>, Kris says...The fix of this bug _was_ documented in the changelog. But it's vanished. And using "init" as a member name is silly - it eclipses the built-in .init property, screwing up generic programming. I don't know why Walter didn't make this illegal. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.FWIW, I can't reproduce this with DMD .120.
Apr 12 2005
"Kris" <fu bar.com> wrote in message news:d37pf8$17b3$2 digitaldaemon.com...class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.The following compiles and runs fine: class Foo { int init (int x) { return 1; } static int init (long y) { return 2; } } void main() { Foo f = new Foo(); int i; i = f.init(1); assert(i == 1); i = f.init(1L); assert(i == 2); }
Apr 09 2005
Thanks; the issue was resolved via the fixes in v119 (which couldn't be used due to that "base-class forward-ref" bug). "Walter" <newshound digitalmars.com> wrote in message news:d399dv$1jp6$1 digitaldaemon.com..."Kris" <fu bar.com> wrote in messagenews:d37pf8$17b3$2 digitaldaemon.com...class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.The following compiles and runs fine: class Foo { int init (int x) { return 1; } static int init (long y) { return 2; } } void main() { Foo f = new Foo(); int i; i = f.init(1); assert(i == 1); i = f.init(1L); assert(i == 2); }
Apr 09 2005
I get this with 0.123: test.d(13): 'this' is required, but test.Foo is not a base class of Bar test.d(13): class test.Bar member hash is not accessible Both of which don't make sense to me.. module test; public class Foo { public int hash() {} public static int hash(double val) {} } public class Bar { public int hash() { return Foo.hash(1); } } xs0 PS: it happens if there is code in funcs, too Walter wrote:"Kris" <fu bar.com> wrote in message news:d37pf8$17b3$2 digitaldaemon.com...class Foo { void init (int x) {} static void init (long y) {} } Given the above, an attempt to call either one causes a compile error; changing one of the method names resolves the conflict.The following compiles and runs fine: class Foo { int init (int x) { return 1; } static int init (long y) { return 2; } } void main() { Foo f = new Foo(); int i; i = f.init(1); assert(i == 1); i = f.init(1L); assert(i == 2); }
May 12 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 xs0 schrieb am Thu, 12 May 2005 16:00:38 +0200:I get this with 0.123: test.d(13): 'this' is required, but test.Foo is not a base class of Bar test.d(13): class test.Bar member hash is not accessible Both of which don't make sense to me.. module test; public class Foo { public int hash() {} public static int hash(double val) {} } public class Bar { public int hash() { return Foo.hash(1); } }Added to DStress as http://dstress.kuehne.cn/run/s/static_30_A.d http://dstress.kuehne.cn/run/s/static_30_B.d http://dstress.kuehne.cn/run/s/static_30_C.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFChZ5w3w+/yD4P9tIRAvkRAJ9Hw40Dj9WUNtghecYNnRPhSb5BtgCgzsu9 pQJ7k0BrkFgiOJX+FHFcduI= =DZsx -----END PGP SIGNATURE-----
May 13 2005