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 types. #52

Merged
merged 1 commit into from
Aug 24, 2020

Conversation

fadulalla
Copy link
Contributor

resolves #51

  • This only deals with primitive types using the conversion table from microsoft. It does not fix issue BigInteger context functions not working #37 as BigInteger is not a primitive, nevertheless it does lay the ground work for it if someone wants to take it on.
  • The implementation does not use the complex comparison defined by the csharp language specification in section "7.4.3.4 Better conversion from type" (online version). Instead, it uses a simplified approach where for every implicit conversion performed, memberFunctionScore is incremented by one. The function with the lowest score is chosen. (A score of 0 indicates a perfect match between supplied arguments and candidate function parameters.)
  • I removed paramsMatchArguments because it is not required (and keeping it introduces a bug with this implementation).
  • I am not too sure of this approach so all aspects of this PR are open to suggestions.

Thanks for the speedy review of the inheritance issue btw, hopefully it'll be a while before you see another PR from me! :)

@sklose sklose merged commit 989668d into sklose:master Aug 24, 2020
@fadulalla fadulalla deleted the support-implicit-conversion branch March 14, 2022 10:34
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.

Support implicit conversion for primitive-type arguments.
3 participants