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

Incorrect method dispatch for overloaded methods using implicit parameters #15989

Closed
WojciechMazur opened this issue Sep 7, 2022 · 2 comments
Labels
itype:bug regression This worked in a previous version but doesn't anymore stat:fix available

Comments

@WojciechMazur
Copy link
Contributor

WojciechMazur commented Sep 7, 2022

Regression found in Open CB #4753 for tofu-tf/glass
Part of 3.2.1-RC1 regression tracker #15949

Compiler version

3.2.1-RC1

Bisect points to 882b435

Minimized code

type Contains[A, B]   = PContains[A, A, B, B]

abstract class MonoOpticCompanion:
  type O[a, b]
  def apply[A, B](implicit o: O[A, B]): O[A, B] = o

trait PContains[-S, +T, +A, -B]:
  def apply(a: B): Unit = ???

object Contains extends MonoOpticCompanion:
  def apply[A] = new ContainsApplied[A](true)

  class ContainsApplied[A](private val dummy: Boolean) extends AnyVal:
    def apply[B](fget: A => B)(fset: (A, B) => A): Contains[A, B] = ???

trait CollectionFunctions:
  def setAt[A](a: A): Contains[Set[A], Boolean] =
    Contains[Set[A]](???)(???) // error

Output

Compiling project (Scala 3.2.1-RC1, JVM)
[error] ./lib.scala:18:5: method apply in object Contains does not take parameters
[error]     Contains[Set[A]](???)(???) // error
[error]     ^^^^^^^^^^^^^^^^

Expectation

Should compile

@WojciechMazur WojciechMazur added itype:bug regression This worked in a previous version but doesn't anymore stat:needs triage Every issue needs to have an "area" and "itype" label labels Sep 7, 2022
@odersky
Copy link
Contributor

odersky commented Sep 8, 2022

This was fixed by #15970

@odersky odersky closed this as completed Sep 8, 2022
@odersky odersky added stat:fix available and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Sep 8, 2022
@WojciechMazur
Copy link
Contributor Author

Can confirm it now works using Scala 3.2.2-RC1-bin-20220907-a503b7a-NIGHTLY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug regression This worked in a previous version but doesn't anymore stat:fix available
Projects
None yet
Development

No branches or pull requests

2 participants