summaryrefslogtreecommitdiff
path: root/test/files/pos/t2421.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2009-10-06 10:44:57 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2009-10-06 10:44:57 +0000
commit7f2eaea3e7f08c6fcb53b6c7d7f35bbb4a82ebf5 (patch)
treea4fdb4b6811463870547ca93ab02b9135db4faab /test/files/pos/t2421.scala
parent5da791d8c4987d4fa532985d451e3a9369a85556 (diff)
downloadscala-7f2eaea3e7f08c6fcb53b6c7d7f35bbb4a82ebf5.tar.gz
scala-7f2eaea3e7f08c6fcb53b6c7d7f35bbb4a82ebf5.tar.bz2
scala-7f2eaea3e7f08c6fcb53b6c7d7f35bbb4a82ebf5.zip
fixed #2421: checkBounds in typedImplicit0 to f...
fixed #2421: checkBounds in typedImplicit0 to filter out implicit searchresults that result in nonsenical type instantiations
Diffstat (limited to 'test/files/pos/t2421.scala')
-rw-r--r--test/files/pos/t2421.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/pos/t2421.scala b/test/files/pos/t2421.scala
new file mode 100644
index 0000000000..0d01be29fc
--- /dev/null
+++ b/test/files/pos/t2421.scala
@@ -0,0 +1,14 @@
+object Test {
+ abstract class <~<[-From, +To] extends (From => To)
+ implicit def trivial[A]: A <~< A = error("")
+
+
+ trait Forcible[T]
+ implicit val forcibleInt: (Int <~< Forcible[Int]) = error("")
+
+ def headProxy[P <: Forcible[Int]](implicit w: Int <~< P): P = 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
+} \ No newline at end of file