diff options
Diffstat (limited to 'tests/untried/neg')
-rw-r--r-- | tests/untried/neg/literate_existentials.scala | 12 | ||||
-rw-r--r-- | tests/untried/neg/t0764.scala | 2 | ||||
-rw-r--r-- | tests/untried/neg/t2066b.scala | 2 | ||||
-rw-r--r-- | tests/untried/neg/t7872.scala | 2 | ||||
-rw-r--r-- | tests/untried/neg/t7872b.scala | 8 | ||||
-rw-r--r-- | tests/untried/neg/t7872c.scala | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/tests/untried/neg/literate_existentials.scala b/tests/untried/neg/literate_existentials.scala index 8580347bf..fe47bd5fb 100644 --- a/tests/untried/neg/literate_existentials.scala +++ b/tests/untried/neg/literate_existentials.scala @@ -54,7 +54,7 @@ object LiterateExistentials { // V1 <: Any // // Which simplify to: -// V1 >: String <: Any +// V1 >: String <: Any // // That's not inconsistent, so we can say that: // T <: U forSome { type X1 >: L1 <: H1 } @@ -62,7 +62,7 @@ object LiterateExistentials { // Nothing <: A forSome { type A >: String <: Any } // Now to ask the compiler: - + implicitly[Nothing <:< (A forSome { type A >: String <: Any })] @@ -85,15 +85,15 @@ object LiterateExistentials { // // Which simplify to: // -// V1 >: lub(Int, String) <: Any +// V1 >: lub(Int, String) <: Any // -// V1 >: Any <: Any +// V1 >: Any <: Any // // We have demonstrated consistency! We can say that: // T :< (U forSome { type U >: L1 <: H1 }) // Under our bindings, this is: // Int :< (M forSome { type M >: String <: Any }) - + implicitly[Int <:< (M forSome { type M >: String <: Any })] @@ -179,7 +179,7 @@ object LiterateExistentials { // Nothing <: V1 // V1 <: String // -// V1 >: Int <: String +// V1 >: Int <: String // // Alas! These are inconsistent! There is no supertype of Int that is a // subtype of String! Our substitution rule does not allow us to claim that our diff --git a/tests/untried/neg/t0764.scala b/tests/untried/neg/t0764.scala index 7ee76feab..0c3f857a8 100644 --- a/tests/untried/neg/t0764.scala +++ b/tests/untried/neg/t0764.scala @@ -29,7 +29,7 @@ _1.type <:< Node{type T = NextType} (because skolemization and _1's upper bound) Node{type T = NextType} <:< _1.type forSome val _1: Node{type T = NextType} because: Node{type T = NextType} <:< T forSome {type T <: Node{type T = NextType} with Singleton} -because +because Node{type T = NextType} <:< Node{type T = NextType} with Singleton hmmm.. might the with Singleton be throwing a wrench in our existential house? diff --git a/tests/untried/neg/t2066b.scala b/tests/untried/neg/t2066b.scala index aebf761fc..b309a48d6 100644 --- a/tests/untried/neg/t2066b.scala +++ b/tests/untried/neg/t2066b.scala @@ -11,6 +11,6 @@ object Test extends App { val p = new P(1) val palias = (new B():A).f[P](p) - palias.y = "hello" + palias.y = "hello" val z: Int = p.y } diff --git a/tests/untried/neg/t7872.scala b/tests/untried/neg/t7872.scala index 66d22a071..55480be6a 100644 --- a/tests/untried/neg/t7872.scala +++ b/tests/untried/neg/t7872.scala @@ -1,7 +1,7 @@ trait Cov[+A] trait Inv[-A] -object varianceExploit { +object varianceExploit { type l[-a] = Cov[a] type x = {type l[-a] = Cov[a]} def foo[M[_]] = () diff --git a/tests/untried/neg/t7872b.scala b/tests/untried/neg/t7872b.scala index 307a1470c..e76145cce 100644 --- a/tests/untried/neg/t7872b.scala +++ b/tests/untried/neg/t7872b.scala @@ -1,20 +1,20 @@ object coinv { def up[F[+_]](fa: F[String]): F[Object] = fa def down[F[-_]](fa: F[Object]): F[String] = fa - + up(List("hi")) - + // should not compile; `l' is unsound def oops1 = down[({type l[-a] = List[a]})#l](List('whatever: Object)).head + "oops" // scala> oops1 // java.lang.ClassCastException: scala.Symbol cannot be cast to java.lang.String // at com.nocandysw.coinv$.oops1(coinv.scala:12) - + type Stringer[-A] = A => String down[Stringer](_.toString) // [error] type A is contravariant, but type _ is declared covariant // up[Stringer]("printed: " + _) - + // should not compile; `l' is unsound def oops2 = up[({type l[+a] = Stringer[a]})#l]("printed: " + _) // scala> oops2(Some(33)) diff --git a/tests/untried/neg/t7872c.scala b/tests/untried/neg/t7872c.scala index fa12a523b..112248bc8 100644 --- a/tests/untried/neg/t7872c.scala +++ b/tests/untried/neg/t7872c.scala @@ -1,7 +1,7 @@ object coinv { def up[F[+_]](fa: F[String]): F[Object] = fa def down[F[-_]](fa: F[Object]): F[String] = fa - + up(List("hi")) // [error] type A is covariant, but type _ is declared contravariant down(List('whatever: Object)) |