Skip to content

Implicit class with two arguments does not fail compilation #3540

Closed
@nicolasstucki

Description

@nicolasstucki
object Test {
  implicit class Foo(i: Int, s: String)
}

Fails in scalac with

Foo.scala:2: error: implicit classes must accept exactly one primary constructor parameter
  implicit class Foo(i: Int, s: String)
                 ^
one error found

But not on dotc. This error should probably be emitted when desugaring the implicit class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions