Dotty: final implicit class can be overridden

Created on 15 Aug 2018  路  2Comments  路  Source: lampepfl/dotty

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 https://github.com/scala/bug/issues/11078

novice help wanted bug low

All 2 comments

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

odersky picture odersky  路  94Comments

felixmulder picture felixmulder  路  120Comments

odersky picture odersky  路  28Comments

smarter picture smarter  路  40Comments

letalvoj picture letalvoj  路  27Comments