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

Fix i14451 #16010

Merged
Merged

Conversation

Sporarum
Copy link
Contributor

@Sporarum Sporarum commented Sep 9, 2022

Fixes #14451

Implicitly assumed type clauses could only be at the beginning, which is wrong since:

extension (x: Int) def foo[T](y: T) = ???

de-sugars to something like:

def foo(x: Int)[T](y: T) = ???

To fix it, I implement stripInferrable, a variant of stripImplicit which also drops type clauses, and use it in resultIsMethod
I suspect the other uses of stripImplicit could be simplified, or even fixed (assuming they make the same mistake as resultIsMethod), by using stripInferrable

@Sporarum Sporarum self-assigned this Sep 9, 2022
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, this looks good to me.

@Sporarum Sporarum force-pushed the fix-extention-ambiguity-by-typeparam branch from a7f1b54 to c87e56b Compare September 15, 2022 08:46
@bishabosha bishabosha merged commit 9cbc48b into scala:main Sep 15, 2022
@Sporarum Sporarum deleted the fix-extention-ambiguity-by-typeparam branch September 15, 2022 11:11
@Kordyjan Kordyjan added this to the 3.2.2 milestone Aug 1, 2023
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.

Extension methods ambiguity when type argument is added
4 participants