[Issue 4702] Long Postfix not working with cross-module overloading

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 30 14:14:38 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4702



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2010-12-30 14:12:29 PST ---
OOPS!

That example code is completely wrong, please diregard it. This is the proper
one which should work but doesn't:

main.d:
import std.stdio : writeln;
import foo;     // void fun(int x)
import bar;     // void fun(long x)

void main()
{
    auto y = 10L;
    fun(y);                 // ok, goes to bar.fun

    writeln(typeid(10L));   // writes long
    fun(10L);               // error: bar.fun conflicts with foo.fun
}

foo.d:
void fun(int x)
{
}

bar.d:
void fun(long x)
{
}


This only happens with literals and when the two fun methods are defined in
separate modules. If the fun methods are defined directly in main(), there's no
error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list