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

Regression in overloading methods using multiple parameter lists with default arguments #16484

Closed
WojciechMazur opened this issue Dec 9, 2022 · 0 comments · Fixed by #16485
Closed
Assignees
Labels
area:overloading itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@WojciechMazur
Copy link
Contributor

Based on the Open CB failure for kiberstender/fjwt - https://scala3.westeurope.cloudapp.azure.com/job/buildCommunityProject/26256/

Compiler version

Bisect points to 063579a

Minimized code

trait JWTEncoder[F[*]]:
  def encode[P](arg: String)(opt: Option[String] = None): F[String]
  def encode[P](arg: String): F[String] = encode(arg)()

Output

Compiling project (Scala 3.3.0-RC1-bin-20221205-5cf8a58-NIGHTLY, JVM)
[error] /home/wmazur/projects/virtuslab/bisect/test.scala:3:43: None of the overloaded alternatives of method encode in trait JWTEncoder with types
[error]  [P](arg: String): F[String]
[error]  [P](arg: String)(opt: Option[String]): F[String]
[error] match arguments ((arg : String))()
[error] 
[error] where:    F is a type in trait JWTEncoder with bounds <: [*] =>> Any
[error]   def encode[P](arg: String): F[String] = encode(arg)()
[error]                                           ^^^^^^
Error compiling project (Scala 3.3.0-RC1-bin-20221205-5cf8a58-NIGHTLY, JVM)

Expectation

Should compile

@WojciechMazur WojciechMazur added itype:bug area:overloading regression This worked in a previous version but doesn't anymore labels Dec 9, 2022
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 9, 2022
@odersky odersky self-assigned this Dec 9, 2022
Kordyjan pushed a commit to dotty-staging/dotty that referenced this issue Dec 22, 2022
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:overloading itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants