Closed
Description
Compiler version
3.0.0-RC2
Minimized code and output
trait A[T]:
def f: T
trait B[T: A]:
println(summon[A[T]].f)
trait C[T: A] extends B[T]
given A[Int] with
def f = 1
class D extends C[Int]:
given A[Int] with
def f = 2
new D
// 2
Expectation : the compiler should not be distracted by the inner given
:
class D extends C[Int]:
//given A[Int] with
// def f = 2
new D
// 1
Note that the problem does not occur when extending B
directly:
class D extends B[Int]:
given A[Int] with
def f = 2
new D
// 1