diff options
Diffstat (limited to 'test/files/run/t7932.scala')
-rw-r--r-- | test/files/run/t7932.scala | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/test/files/run/t7932.scala b/test/files/run/t7932.scala index 8743abff88..e6bdbf2417 100644 --- a/test/files/run/t7932.scala +++ b/test/files/run/t7932.scala @@ -1,11 +1,28 @@ +import scala.language.higherKinds + class Category[M[_, _]] -trait M[F] { + +trait M1[F] { type X[a, b] = F def category: Category[X] = null def category1: Category[Tuple2] = null } -abstract class C extends M[Float] + +// 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 { - val ms = classOf[C].getMethods.filter(_.getName.startsWith("category")) - println(ms.map(_.toGenericString).sorted.mkString("\n")) + 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[_]]) } |