Overloading issue with enum in dmd 1.006

Thomas Kuehne thomas-dloop at kuehne.cn
Tue Feb 27 11:33:08 PST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

renoX schrieb am 2007-02-20:
> Tested in dmd 1.006 on Linux, the two toString definitions conflicts 
> when they are in main, not when they are out of the main function.
>
> import std.stdio;
> int main(char[][] args)
> {	
> 	enum Foo { A , B };
> 	enum Foo2 { C , D };
> 	
> 	char[] toString(Foo x)
> 	{
> 		return "1";
> 	}
> 	char[] toString(Foo2 x)
> 	{
> 		return "2";
> 	}	

<snip>

http://www.digitalmars.com/d/function.html
> Unlike module level declarations, declarations within function scope are
> processed in order.

Thus no overloading for nested functions.

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFF5JQELK5blCcjpWoRAuAYAKCe657u4RV2QFzRiGnEle01XRlkAwCfWStE
4vwsRjflR46EqJ1j18VhDwI=
=TkIY
-----END PGP SIGNATURE-----


More information about the Digitalmars-d-bugs mailing list