diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/falseView.scala | 7 | ||||
-rw-r--r-- | tests/pos/t2421_delitedsl.scala | 3 | ||||
-rw-r--r-- | tests/run/t8280.check | 3 | ||||
-rw-r--r-- | tests/run/t8280.scala | 3 |
4 files changed, 13 insertions, 3 deletions
diff --git a/tests/neg/falseView.scala b/tests/neg/falseView.scala new file mode 100644 index 000000000..613abe3f1 --- /dev/null +++ b/tests/neg/falseView.scala @@ -0,0 +1,7 @@ +object Test { + + private implicit val xs: Map[String, Int] = ??? + + val x: Int = "abc" // error + +} diff --git a/tests/pos/t2421_delitedsl.scala b/tests/pos/t2421_delitedsl.scala index 22f1ecd85..bde3593c9 100644 --- a/tests/pos/t2421_delitedsl.scala +++ b/tests/pos/t2421_delitedsl.scala @@ -1,6 +1,9 @@ trait DeliteDSL { abstract class <~<[-From, +To] extends (From => To) + implicit def trivial[A]: A <~< A = new (A <~< A) {def apply(x: A) = x} + implicit def convert_<-<[A, B](x: A)(implicit ev: A <~< B): B = ev(x) + trait Forcible[T] object Forcible { diff --git a/tests/run/t8280.check b/tests/run/t8280.check index 44c51f5aa..b5885df48 100644 --- a/tests/run/t8280.check +++ b/tests/run/t8280.check @@ -1,7 +1,6 @@ -Int -Int Long Int Int Int Int +Int diff --git a/tests/run/t8280.scala b/tests/run/t8280.scala index f433dcc32..1d2c56b85 100644 --- a/tests/run/t8280.scala +++ b/tests/run/t8280.scala @@ -37,7 +37,8 @@ object Moop1 { implicit object f1 extends (Int => String) { def apply(x: Int): String = "Int" } implicit val f2: Long => String = _ => "Long" - println(5: String) + //println(5: String) + // This picked f1 before, but is now disallowed since subtypes of functions are no longer implicit conversions } } |