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

Support implicit conversion for primitive-type arguments. #51

Closed
fadulalla opened this issue Aug 20, 2020 · 0 comments · Fixed by #52
Closed

Support implicit conversion for primitive-type arguments. #51

fadulalla opened this issue Aug 20, 2020 · 0 comments · Fixed by #52

Comments

@fadulalla
Copy link
Contributor

Currently, in order for a method to be found in a lambda context, the arguments must match the parameters exactly.

For example:

public class Context {
   int Sum(double a, double b) => a + b;
}

Sum(1.0, 1.0); // returns 2
Sum(1, 1);      // throws a "method not found" exception, but ideally it should return 2.

Even though an int can be implicitly cast to a double, the method fails.
This is similar to issue #37 but deals with primitive types only.

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 a pull request may close this issue.

1 participant