diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-09-14 13:55:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-14 13:55:06 +0200 |
commit | 3f3df3d8f7638eb5cca9ae8162f8388373c912c6 (patch) | |
tree | ab9e376a8e55d8cead82dd8e9c3bfa47ebc521d0 /tests | |
parent | d63dd11ed31f5b500fd08d630bbaec144dbee370 (diff) | |
parent | a4c352a72319b870ae84ad8ca7a3ca039c8f6bb5 (diff) | |
download | dotty-3f3df3d8f7638eb5cca9ae8162f8388373c912c6.tar.gz dotty-3f3df3d8f7638eb5cca9ae8162f8388373c912c6.tar.bz2 dotty-3f3df3d8f7638eb5cca9ae8162f8388373c912c6.zip |
Merge pull request #1466 from dotty-staging/more-run-tests
More run tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/disabled/not-representable/t2337.scala (renamed from tests/pending/run/t2337.scala) | 2 | ||||
-rw-r--r-- | tests/pending/run/t2337.check | 4 | ||||
-rw-r--r-- | tests/pending/run/t3150.scala | 36 | ||||
-rw-r--r-- | tests/pending/run/unapply.check | 3 | ||||
-rw-r--r-- | tests/pos-scala2/t3050.scala (renamed from tests/pending/run/t3050.scala) | 0 | ||||
-rw-r--r-- | tests/run/t298.check (renamed from tests/pending/run/t298.check) | 0 | ||||
-rw-r--r-- | tests/run/t298.scala (renamed from tests/pending/run/t298.scala) | 0 | ||||
-rw-r--r-- | tests/run/t3026.check (renamed from tests/pending/run/t3026.check) | 0 | ||||
-rwxr-xr-x | tests/run/t3026.scala (renamed from tests/pending/run/t3026.scala) | 0 | ||||
-rw-r--r-- | tests/run/t3353.check (renamed from tests/pending/run/t3353.check) | 0 | ||||
-rw-r--r-- | tests/run/t3353.scala (renamed from tests/pending/run/t3353.scala) | 0 | ||||
-rw-r--r-- | tests/run/unapply.scala (renamed from tests/pending/run/unapply.scala) | 4 |
12 files changed, 29 insertions, 20 deletions
diff --git a/tests/pending/run/t2337.scala b/tests/disabled/not-representable/t2337.scala index edb574cba..9e3b8c555 100644 --- a/tests/pending/run/t2337.scala +++ b/tests/disabled/not-representable/t2337.scala @@ -1,4 +1,4 @@ - +// Failure of autotupling in the presence of overloaded functions. object Test { def compare(first: Any, second: Any): Any = { diff --git a/tests/pending/run/t2337.check b/tests/pending/run/t2337.check deleted file mode 100644 index 18f1f66fc..000000000 --- a/tests/pending/run/t2337.check +++ /dev/null @@ -1,4 +0,0 @@ -(Both Int,-1,-1) -(Both Float,1,1) -(Float then Int,0,0) -(Int then Float,0,0) diff --git a/tests/pending/run/t3150.scala b/tests/pending/run/t3150.scala index 034703b5f..dc95af373 100644 --- a/tests/pending/run/t3150.scala +++ b/tests/pending/run/t3150.scala @@ -1,10 +1,26 @@ -object Test { - case object Bob { override def equals(other: Any) = true } - def f(x: Any) = x match { case Bob => Bob } - - def main(args: Array[String]): Unit = { - assert(f(Bob) eq Bob) - assert(f(0) eq Bob) - assert(f(Nil) eq Bob) - } -} + object Test { + case object Bob { override def equals(other: Any) = true } + + class Bob2 { + override def equals(other: Any) = true + } + val Bob2 = new Bob2 + + def f0(x: Any) = x match { case Bob2 => Bob2 } // class cast exception at runtime, dotc only + def f1(x: Any) = x match { case Bob => Bob } // class cast exception at runtime, dotc only + def f2(x: Any): Bob.type = x match { case x @ Bob => x } // class cast exception at runtime, dotc and javac. + + def main(args: Array[String]): Unit = { + assert(f0(Bob2) eq Bob2) + assert(f0(0) eq Bob2) // only dotty fails here + assert(f0(Nil) eq Bob2) + + assert(f1(Bob) eq Bob) + assert(f1(0) eq Bob) // only dotty fails here + assert(f1(Nil) eq Bob) + + assert(f2(Bob) eq Bob) + assert(f2(0) eq Bob) // both dotty and scalac fail here + assert(f2(Nil) eq Bob) + } + } diff --git a/tests/pending/run/unapply.check b/tests/pending/run/unapply.check deleted file mode 100644 index 847e3b381..000000000 --- a/tests/pending/run/unapply.check +++ /dev/null @@ -1,3 +0,0 @@ -unapply.scala:57: warning: comparing values of types Null and Null using `==' will always yield true - assert(doMatch2(b) == null) - ^ diff --git a/tests/pending/run/t3050.scala b/tests/pos-scala2/t3050.scala index 160f8b664..160f8b664 100644 --- a/tests/pending/run/t3050.scala +++ b/tests/pos-scala2/t3050.scala diff --git a/tests/pending/run/t298.check b/tests/run/t298.check index 1cd1d2266..1cd1d2266 100644 --- a/tests/pending/run/t298.check +++ b/tests/run/t298.check diff --git a/tests/pending/run/t298.scala b/tests/run/t298.scala index 5728bb6c9..5728bb6c9 100644 --- a/tests/pending/run/t298.scala +++ b/tests/run/t298.scala diff --git a/tests/pending/run/t3026.check b/tests/run/t3026.check index 8c29b615f..8c29b615f 100644 --- a/tests/pending/run/t3026.check +++ b/tests/run/t3026.check diff --git a/tests/pending/run/t3026.scala b/tests/run/t3026.scala index 22dde9cc0..22dde9cc0 100755 --- a/tests/pending/run/t3026.scala +++ b/tests/run/t3026.scala diff --git a/tests/pending/run/t3353.check b/tests/run/t3353.check index 8b4ae1fe6..8b4ae1fe6 100644 --- a/tests/pending/run/t3353.check +++ b/tests/run/t3353.check diff --git a/tests/pending/run/t3353.scala b/tests/run/t3353.scala index 472723b3c..472723b3c 100644 --- a/tests/pending/run/t3353.scala +++ b/tests/run/t3353.scala diff --git a/tests/pending/run/unapply.scala b/tests/run/unapply.scala index 43f02b9f3..7b10030ba 100644 --- a/tests/pending/run/unapply.scala +++ b/tests/run/unapply.scala @@ -87,8 +87,8 @@ object Mas { object LisSeqArr { def run(): Unit = { - assert((1,2) == ((List(1,2,3): Any) match { case List(x,y,_*) => (x,y)})) - assert((1,2) == ((List(1,2,3): Any) match { case Seq(x,y,_*) => (x,y)})) + assert((1,2) == ((List(1,2,3): Any) match { case List(x,y,_: _*) => (x,y)})) + assert((1,2) == ((List(1,2,3): Any) match { case Seq(x,y,_: _*) => (x,y)})) } } |