Skip to content

More run tests #1466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// Failure of autotupling in the presence of overloaded functions.
object Test {

def compare(first: Any, second: Any): Any = {
Expand Down
4 changes: 0 additions & 4 deletions tests/pending/run/t2337.check

This file was deleted.

36 changes: 26 additions & 10 deletions tests/pending/run/t3150.scala
Original file line number Diff line number Diff line change
@@ -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)
}
}
3 changes: 0 additions & 3 deletions tests/pending/run/unapply.check

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.
4 changes: 2 additions & 2 deletions tests/pending/run/unapply.scala → tests/run/unapply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)}))
}
}

Expand Down