Skip to content

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

Closed
@WojciechMazur

Description

@WojciechMazur

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions