Skip to content

Commit 3f3df3d

Browse files
authored
Merge pull request #1466 from dotty-staging/more-run-tests
More run tests
2 parents d63dd11 + a4c352a commit 3f3df3d

File tree

12 files changed

+29
-20
lines changed

12 files changed

+29
-20
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.

tests/pending/run/unapply.scala renamed to tests/run/unapply.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ object Mas {
8787

8888
object LisSeqArr {
8989
def run(): Unit = {
90-
assert((1,2) == ((List(1,2,3): Any) match { case List(x,y,_*) => (x,y)}))
91-
assert((1,2) == ((List(1,2,3): Any) match { case Seq(x,y,_*) => (x,y)}))
90+
assert((1,2) == ((List(1,2,3): Any) match { case List(x,y,_: _*) => (x,y)}))
91+
assert((1,2) == ((List(1,2,3): Any) match { case Seq(x,y,_: _*) => (x,y)}))
9292
}
9393
}
9494

0 commit comments

Comments
 (0)