Skip to content
This repository has been archived by the owner on Aug 2, 2019. It is now read-only.

Overload resolution ambiguous for implicit cast #7

Open
pvginkel opened this issue Apr 1, 2012 · 0 comments
Open

Overload resolution ambiguous for implicit cast #7

pvginkel opened this issue Apr 1, 2012 · 0 comments
Labels

Comments

@pvginkel
Copy link
Owner

pvginkel commented Apr 1, 2012

There is a failing unit test which pertains to overload resolution. The following case fails to find the correct overload:

void Method(float a) { }
void Method(double a) { }

Method(1)

The problem here is that integer can be implicitly casted to both float and double, and the overload resolution mechanism currently doesn't score overloads which are matched through implicit casts. C# b.t.w. calls the method with the float argument.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant