File: t2712-3.scala

package info (click to toggle)
scala 2.11.12-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 62,924 kB
  • sloc: javascript: 28,808; java: 13,415; xml: 3,135; sh: 1,620; python: 756; makefile: 38; awk: 36; ansic: 6
file content (24 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package test

object Test1 {
  class Foo[T, F[_]]
  def meh[M[_[_]], F[_]](x: M[F]): M[F] = x
  meh(new Foo[Int, List]) // solves ?M = [X[_]]Foo[Int, X[_]] ?A = List ...
}

object Test2 {
  trait TC[T]
  class Foo[F[_], G[_]]
  def meh[G[_[_]]](g: G[TC]) = ???
  meh(new Foo[TC, TC]) // solves ?G = [X[_]]Foo[TC, X]
}

object Test3 {
  trait TC[F[_]]
  trait TC2[F[_]]
  class Foo[F[_[_]], G[_[_]]]
  new Foo[TC, TC2]

  def meh[G[_[_[_]]]](g: G[TC2]) = ???
  meh(new Foo[TC, TC2]) // solves ?G = [X[_[_]]]Foo[TC, X]
}