summaryrefslogblamecommitdiff
path: root/test/files/pos/tcpoly_gm.scala
blob: 89b66cfba65df0703fd70016974a81d2bf37634c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
              









                                                                                    
            

   
trait Rep[a] {
  def rep[m[x]]: m[a] // typedTypeApply must use asSeenFrom to adapt the return type
   // since rep is called on x: Rep[t]
   // a must become t
}

case class ShowBin[b](app: b => String)

object foo {
  def showBin[t](x: Rep[t], y: t): String = {
    val r: ShowBin[t] = x.rep[ShowBin]
    r.app(y)
  }
}