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

Attempt implicit search for old style implicit parameters in Application matchArgs #19737

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

EugeneFlesselle
Copy link
Contributor

@EugeneFlesselle EugeneFlesselle commented Feb 19, 2024

Fixes #19594

@EugeneFlesselle EugeneFlesselle changed the title [WIP] Attempt implicit search for old style implicit parameters [WIP] Attempt implicit search for old style implicit parameters in Application matchArgs Feb 19, 2024
@EugeneFlesselle EugeneFlesselle changed the title [WIP] Attempt implicit search for old style implicit parameters in Application matchArgs Attempt implicit search for old style implicit parameters in Application matchArgs Feb 20, 2024
@EugeneFlesselle EugeneFlesselle marked this pull request as ready for review February 20, 2024 08:10
@@ -638,7 +638,7 @@ trait Applications extends Compatibility {
defaultArg.tpe.widen match
case _: MethodOrPoly if testOnly => matchArgs(args1, formals1, n + 1)
case _ => matchArgs(args1, addTyped(treeToArg(defaultArg)), n + 1)
else if methodType.isContextualMethod && ctx.mode.is(Mode.ImplicitsEnabled) then
else if methodType.isImplicitMethod && ctx.mode.is(Mode.ImplicitsEnabled) then
Copy link
Member

Choose a reason for hiding this comment

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

isImplicitMethod covers both implicit and contextual 👍🏻

    final override def isImplicitMethod: Boolean =
      companion.eq(ImplicitMethodType) || isContextualMethod

@hamzaremmal hamzaremmal merged commit cd65eb9 into scala:main Feb 25, 2024
19 checks passed
@hamzaremmal hamzaremmal deleted the i19594 branch February 25, 2024 17:03
@valencik
Copy link
Contributor

Will this be in the 3.3.2 release? Or does it need to be back ported?

@hamzaremmal
Copy link
Member

No, 3.3.2 is already in Maven Central.
I would expect this to be backported at some point yes. (@Kordyjan can give you the definitive answer)

@Kordyjan Kordyjan added this to the 3.4.2 milestone Mar 28, 2024
mzuehlke added a commit to mzuehlke/munit that referenced this pull request Apr 26, 2024
As there isn't an artifact for Scala 3 LTS that includes scala/scala3#20171
I gave it a try with 3.4.2-RC1 that already contains scala/scala3#19737

This PR shows that the only thing that changes is the message returned form the compiler and not changes to munit are needed once Scala 3 LTS with the fix gets released.
WojciechMazur added a commit that referenced this pull request Jul 2, 2024
… in Application matchArgs" to LTS (#20936)

Backports #19737 to the LTS branch.

PR submitted by the release tooling.
[skip ci]
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.

custom implicitNotFound ignored when unrelated default argument is inserted
4 participants