summaryrefslogtreecommitdiff
path: root/test/files/run/t7932.scala
blob: e6bdbf24170c899a179d70009249dd5ca0292b81 (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
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 extends App {
  def t(c: Class[_]) = {
    val ms = c.getMethods.filter(_.getName.startsWith("category"))
    println(ms.map(_.toGenericString).sorted.mkString("\n"))
  }
  t(classOf[C])
  t(classOf[M1[_]])
  t(classOf[M2[_]])
}