Skip to content

final implicit class can be overridden #11078

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

Closed
soronpo opened this issue Aug 15, 2018 · 1 comment
Closed

final implicit class can be overridden #11078

soronpo opened this issue Aug 15, 2018 · 1 comment

Comments

@soronpo
Copy link

soronpo commented Aug 15, 2018

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 in dotty scala/scala3#4948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants