diff options
Diffstat (limited to 'tests/pos/t2421.scala')
-rw-r--r-- | tests/pos/t2421.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/t2421.scala b/tests/pos/t2421.scala new file mode 100644 index 000000000..2544a1cb3 --- /dev/null +++ b/tests/pos/t2421.scala @@ -0,0 +1,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 +} |