aboutsummaryrefslogblamecommitdiff
path: root/tests/pos/t2421.scala
blob: 2544a1cb368c7971c54f32d07cb519f0ecc27262 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                                                                 
object Test {
  abstract class <~<[-From, +To] extends (From => To)
  implicit def trivial[A]: A <~< A = sys.error("")


  trait Forcible[T]
  implicit val forcibleInt: (Int <~< Forcible[Int]) = sys.error("")

  def headProxy[P <: Forcible[Int]](implicit w: Int <~< P): P = sys.error("")

  headProxy
  // trivial[Int] should not be considered a valid implicit, since w would have type Int <~< Int,
  // and headProxy's type parameter P cannot be instantiated to Int
}