Skip to content

final implicit class can be overridden #4948

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 · 2 comments
Closed

final implicit class can be overridden #4948

soronpo opened this issue Aug 15, 2018 · 2 comments

Comments

@soronpo
Copy link
Contributor

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 as in scalc scala/bug#11078

@soronpo
Copy link
Contributor Author

soronpo commented Aug 15, 2018

@smarter can you to point me to where the desugarimg of implicit classes takes place? I think I'll be able to fix this myself.

@Blaisorblade
Copy link
Contributor

Blaisorblade commented Aug 15, 2018

allanrenucci added a commit that referenced this issue Nov 21, 2018
Fix #4948: final implicit class can be overridden
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

3 participants