diff options
author | Paul Phillips <paulp@improving.org> | 2012-02-23 10:59:55 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-02-23 11:06:14 -0800 |
commit | 622656dfc87100bc94a37f3b244955c96d526023 (patch) | |
tree | 1832c7de4759defc03266e32c33b887554a69647 /test/pending/pos/nothing.scala | |
parent | 119c9554cf948163433ab12ce8cdd36814f63e4a (diff) | |
download | scala-622656dfc87100bc94a37f3b244955c96d526023.tar.gz scala-622656dfc87100bc94a37f3b244955c96d526023.tar.bz2 scala-622656dfc87100bc94a37f3b244955c96d526023.zip |
Moved and edited tests.
Remove obsolete, move passing pending -> files, update
those-kinds-are-high with some new info, added a couple
new ones to pending.
Diffstat (limited to 'test/pending/pos/nothing.scala')
-rw-r--r-- | test/pending/pos/nothing.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/pending/pos/nothing.scala b/test/pending/pos/nothing.scala new file mode 100644 index 0000000000..f76017fb16 --- /dev/null +++ b/test/pending/pos/nothing.scala @@ -0,0 +1,24 @@ +// More shoddy treatment for nothing. +class A { + class Q3A[+T1, T2 <: T1](x: T1) + class Q3B[+T1, T2 <: T1](x: Q3A[T1, T2]) + + val x1 = new Q3B(new Q3A("a")) + val x2 = new Q3B(new Q3A[String, Nothing]("a")) + val x3 = new Q3B(new Q3A[String, Null]("a")) + // test/pending/pos/nothing.scala:5: error: type mismatch; + // found : A.this.Q3A[String,Nothing] + // required: A.this.Q3A[String,T2] + // Note: Nothing <: T2, but class Q3A is invariant in type T2. + // You may wish to define T2 as +T2 instead. (SLS 4.5) + // val x1 = new Q3B(new Q3A("a")) + // ^ + // test/pending/pos/nothing.scala:6: error: type mismatch; + // found : A.this.Q3A[String,Nothing] + // required: A.this.Q3A[String,T2] + // Note: Nothing <: T2, but class Q3A is invariant in type T2. + // You may wish to define T2 as +T2 instead. (SLS 4.5) + // val x2 = new Q3B(new Q3A[String, Nothing]("a")) + // ^ + // two errors found +} |