Skip to content

Error when using two non conflicting apply methods in a row #15969

Closed
@KacperFKorban

Description

@KacperFKorban

Compiler version

3.2.1-RC1-bin-20220831-398b72e-NIGHTLY
compiles correctly with 3.2.0-RC1

Minimized code

object Obj {
  def apply[L]: Unit = ???

  extension (make: Unit) def apply(value: Int): String = ???

  def test: String = Obj[Int](1)
}

Output

[error] ./sagerbug.scala:6:22: method apply in object Obj does not take parameters
[error]   def test: String = Obj[Int](1)
[error]                      ^^^^^^^^

Expectation

Compile correctly.
i.e. Obj[Int](1) should get expanded to calls to both apply methods.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions