summaryrefslogtreecommitdiff
path: root/test/files/run/t7932.scala
blob: 40b0b9989b538d8e599217653382a351c7737f6f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import scala.language.higherKinds

class Category[M[_, _]]

trait M1[F] {
  type X[a, b] = F
  def category: Category[X] = null
  def category1: Category[Tuple2] = null
}

// The second trait is needed to make sure there's a forwarder generated in C.
// otherwise the trait methods are just the inherited default methods from M1.
trait M2[F] { self: M1[F] =>
  override def category: Category[X] = null
  override def category1: Category[Tuple2] = null
}

abstract class C extends M1[Float] with M2[Float]

object Test {
  def t(c: Class[_]) = {
    val ms = c.getMethods.filter(_.getName.startsWith("category"))
    println(ms.map(_.toGenericString).sorted.mkString("\n"))
  }
  def main(args: Array[String]) {
    t(classOf[C])
    t(classOf[M1[_]])
    t(classOf[M2[_]])
  }
}