summaryrefslogblamecommitdiff
path: root/test/files/run/t6554.scala
blob: eed139fea68f1f543e40d172ea827ccc25d0ef66 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
             

                             







                                                                                





                                                                                                      
trait T1[A] {
  def minBy[B](b: B): A = ???
}

// The second trait is needed to make sure there's a forwarder generated in Bar.
// otherwise Bar.minBy is just the inherited default method from T1.
trait T2[A] { self: T1[A] =>
  override def minBy[B](b: B): A = ???
}

class Bar extends T1[Int] with T2[Int]

object Test extends App {
   val sigs = classOf[Bar].getDeclaredMethods.map(m => s"${m.toString} / ${m.toGenericString}").sorted
   println(sigs.mkString("\n"))
}
// Was public java.lang.Object Bar.minBy(java.lang.Object) / public <B> int Bar.minBy(B)