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