Skip to content

final implicit class can be overridden #4948

@soronpo

Description

@soronpo

Overriding a final implicit class's equivalent definition shouldn't be possible.

  trait Foo
  trait Implicits {
    final implicit class FooExtender(foo : Foo) {
      def empty : Unit = {}
    }
  }

  object Test extends Implicits {
    override implicit def FooExtender(foo: Foo): Test.FooExtender = super.FooExtender(foo) //should not be allowed
  }

Same issue as in scalc scala/bug#11078

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