Skip to content

Commit 51201d2

Browse files
oderskyfelixmulder
authored andcommitted
Add some run tests
1 parent d63dd11 commit 51201d2

File tree

11 files changed

+27
-18
lines changed

11 files changed

+27
-18
lines changed

tests/pending/run/t2337.scala renamed to tests/disabled/not-representable/t2337.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// Failure of autotupling in the presence of overloaded functions.
22
object Test {
33

44
def compare(first: Any, second: Any): Any = {

tests/pending/run/t2337.check

Lines changed: 0 additions & 4 deletions
This file was deleted.

tests/pending/run/t3150.scala

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
object Test {
2-
case object Bob { override def equals(other: Any) = true }
3-
def f(x: Any) = x match { case Bob => Bob }
4-
5-
def main(args: Array[String]): Unit = {
6-
assert(f(Bob) eq Bob)
7-
assert(f(0) eq Bob)
8-
assert(f(Nil) eq Bob)
9-
}
10-
}
1+
object Test {
2+
case object Bob { override def equals(other: Any) = true }
3+
4+
class Bob2 {
5+
override def equals(other: Any) = true
6+
}
7+
val Bob2 = new Bob2
8+
9+
def f0(x: Any) = x match { case Bob2 => Bob2 } // class cast exception at runtime, dotc only
10+
def f1(x: Any) = x match { case Bob => Bob } // class cast exception at runtime, dotc only
11+
def f2(x: Any): Bob.type = x match { case x @ Bob => x } // class cast exception at runtime, dotc and javac.
12+
13+
def main(args: Array[String]): Unit = {
14+
assert(f0(Bob2) eq Bob2)
15+
assert(f0(0) eq Bob2) // only dotty fails here
16+
assert(f0(Nil) eq Bob2)
17+
18+
assert(f1(Bob) eq Bob)
19+
assert(f1(0) eq Bob) // only dotty fails here
20+
assert(f1(Nil) eq Bob)
21+
22+
assert(f2(Bob) eq Bob)
23+
assert(f2(0) eq Bob) // both dotty and scalac fail here
24+
assert(f2(Nil) eq Bob)
25+
}
26+
}

tests/pending/run/unapply.check

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)