Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 7196 - Unfair function address overload resolution #600

Merged
merged 1 commit into from
Jan 6, 2012

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Jan 2, 2012

@jpf91
Copy link
Contributor

jpf91 commented Jan 4, 2012

Does this patch also work for templates?

class Foo
{
    void func(double) { }
    void func(int) { }

    void set(T)(T handler) if(is(T == void delegate(int)))
    { dg = handler; }
    void delegate(int) dg;
}

void main()
{
    auto foo = new Foo;
    foo.set(&foo.func);  // NG, func(double) is picked up first
}

@ghost
Copy link

ghost commented Jan 4, 2012

@jpf91 Tried it, but nope. :/

@9rnsr
Copy link
Contributor Author

9rnsr commented Jan 4, 2012

@jpf91, unfortunately, this patch does not support an overload resolution on function argument.

WalterBright added a commit that referenced this pull request Jan 6, 2012
Issue 7196 - Unfair function address overload resolution
@WalterBright WalterBright merged commit 092ae01 into dlang:master Jan 6, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants