summaryrefslogtreecommitdiff
path: root/test/files/pos/tcpoly_return_overriding.scala
blob: 57ec8da76c16b27e255964765918c8f7b9a74b1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
trait Generic[g[x]] {
  def unit: g[Unit]
}

trait Rep[t] {
  def rep[m[x]](implicit gen: Generic[m]): m[t]
}

// testing that the return type is also transformed when checking overriding
// + that substitution (of types&symbols) preserves isHigherKinded when replacing a higher-kinded type with another one
object foo extends Rep[Unit] {
  def rep[g[x]](implicit gen: Generic[g]): g[Unit]= gen.unit
}