-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added in reflect Select.overloaded parameter for expected result type [WIP] #10054
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Commit Messages
We want to keep history, but for that to actually be useful we have
some rules on how to format our commit messages (relevant xkcd).
Please stick to these guidelines for commit messages:
- Separate subject from body with a blank line
- When fixing an issue, start your commit message with
Fix #<ISSUE-NBR>:
- Limit the subject line to 72 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line ("Add" instead of "Added")
- Wrap the body at 80 characters
- Use the body to explain what and why vs. how
adapted from https://chris.beams.io/posts/git-commit
Have an awesome day! ☀️
would it make more sense to add a method that can call with all curried parameter lists? |
From the point of usability, this can be better, but overloading is defined in language specs only for one parameter list. (https://scala-lang.org/files/archive/spec/2.13/06-expressions.html#overloading-resolution ), I guess because it's a beast from the java world. (after reading specs: looks like things like:
should not compile at all. But they compiled. The compiler now counts the weight of the transformations for choosing the best alternative only for the arguments in the first list and uses the second argument list only for return type constraint. If we extending the notion of overloading to multiple argument lists, then we probably should change the logic of the compiler, to use other lists during the generation of alternatives. So, the question is in specs: I see 3 variants of resolution
Interesting question, I don't know the answer. |
My suggestion was to keep calling the |
yes, .. I thinking this can be viewed as priorities. [i.e. choose the first list of arguments by weight, than second ]. ... but not sure exactly, I will prepare a variant with the list. |
Problem with list of list approach: if we assume that the last type should always be a wildcard, then we can't be able to compile our example: compiler assumes that
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix seems good. Just needs some changes in the implementation within QuoteContextImpl. I also suggest to add the high and lower bound methods.
Co-authored-by: Nicolas Stucki <[email protected]>
Co-authored-by: Nicolas Stucki <[email protected]>
Co-authored-by: Nicolas Stucki <[email protected]>
…ontextImpl.scala Co-authored-by: Nicolas Stucki <[email protected]>
Co-authored-by: Nicolas Stucki <[email protected]>
Co-authored-by: Nicolas Stucki <[email protected]>
Thank you @rssh |
Motivation is described in #10053