-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Overload resolution for extension methods fails in some cases where named parameters are involved. #15287
Comments
Invoking f as a standard method: f('c')(false) fails with:
After specyfing default parameter explicitely, everything compiles |
This problem occurs also for standard methods:
|
The problem is that compiler expects the default getter name: |
I give up on this as it turned out to be too complicated case. Resolving overloaded methods for curried methods goes param clause per param clause and it's not aware how it should work with default parameters for further parameter clauses. |
One way to fix this for now is to reject overloaded extension methods that have default arguments. |
I have decided not to attack errors involving default parameters using the old scheme of default parameters any more. It's better to focus on fixing the scheme to use inline which would fix lots of other problems as well. If people want fixes now, someone else should take this on, or we move to backlog. |
Compiler version
3.1.3-RC3, 3.2.0-RC1-bin-20220519-ee9cc8f-NIGHTLY-git-ee9cc8f
Minimized code
Output
Expectation
Compile just fine, return "b"
The text was updated successfully, but these errors were encountered: