aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
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.check4
-rw-r--r--tests/pending/run/t3150.scala36
-rw-r--r--tests/pending/run/unapply.check3
-rw-r--r--tests/pos-scala2/t3050.scala (renamed from tests/pending/run/t3050.scala)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-xtests/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)0
11 files changed, 27 insertions, 18 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.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..43f02b9f3 100644
--- a/tests/pending/run/unapply.scala
+++ b/tests/run/unapply.scala