-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Minimized code
@annotation.implicitNotFound("There's no Foo1")
trait Foo1
@annotation.implicitNotFound("There's no Foo2")
trait Foo2
trait Bar12 extends Foo1 with Foo2
trait Bar21 extends Foo2 with Foo1
object Bar {
implicitly[Bar12]
implicitly[Bar21]
}
Output
no implicit argument of type Bar12 was found for parameter ev of method implicitly in object DottyPredef
no implicit argument of type Bar21 was found for parameter ev of method implicitly in object DottyPredef
Expectation
There's no Foo2
There's no Foo1
According to the comment on scala.annotation.implicitNotFound
:
The annotation is effectively inherited by subtypes if they are not annotated.
In scala 2.13 this works as described. Although not explicitly documented, the order of inheritance is taken into account there and it makes sense to keep this behaviour.