summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-03-05 09:08:58 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-03-05 09:08:58 -0800
commit1176035f271821021c36d1b3cab6b2888e99524d (patch)
tree03008bb9d5ecc30512c54145a48e1dd045578480 /test
parent773f6a8df9ef95852918a706f3f19ebf0431baa8 (diff)
parentf482d5bdd0722e54cb3cfc2219df93da5f435bac (diff)
downloadscala-1176035f271821021c36d1b3cab6b2888e99524d.tar.gz
scala-1176035f271821021c36d1b3cab6b2888e99524d.tar.bz2
scala-1176035f271821021c36d1b3cab6b2888e99524d.zip
Merge pull request #2193 from adriaanm/patmat-refactor
merge 2.10.1 into 2.10.x
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t5954.check16
-rw-r--r--test/files/neg/t5954.flags1
-rw-r--r--test/files/neg/t5954.scala46
-rw-r--r--test/files/pos/t7126.scala11
-rw-r--r--test/files/pos/t7183.flags1
-rw-r--r--test/files/pos/t7183.scala13
6 files changed, 25 insertions, 63 deletions
diff --git a/test/files/neg/t5954.check b/test/files/neg/t5954.check
deleted file mode 100644
index ed10658b24..0000000000
--- a/test/files/neg/t5954.check
+++ /dev/null
@@ -1,16 +0,0 @@
-t5954.scala:36: error: class D should be placed directly in package A instead of package object A. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.
- case class D()
- ^
-t5954.scala:35: error: object C should be placed directly in package A instead of package object A. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.
- object C
- ^
-t5954.scala:34: error: trait C should be placed directly in package A instead of package object A. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.
- trait C
- ^
-t5954.scala:33: error: object B should be placed directly in package A instead of package object A. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.
- object B
- ^
-t5954.scala:32: error: class B should be placed directly in package A instead of package object A. Under some circumstances companion objects and case classes in package objects can fail to recompile. See https://issues.scala-lang.org/browse/SI-5954.
- class B
- ^
-5 errors found
diff --git a/test/files/neg/t5954.flags b/test/files/neg/t5954.flags
deleted file mode 100644
index 85d8eb2ba2..0000000000
--- a/test/files/neg/t5954.flags
+++ /dev/null
@@ -1 +0,0 @@
--Xfatal-warnings
diff --git a/test/files/neg/t5954.scala b/test/files/neg/t5954.scala
deleted file mode 100644
index 3ccb5ed3ff..0000000000
--- a/test/files/neg/t5954.scala
+++ /dev/null
@@ -1,46 +0,0 @@
-// if you ever think you've fixed the underlying reason for the warning
-// imposed by SI-5954, then here's a test that should pass with two "succes"es
-//
-//import scala.tools.partest._
-//
-//object Test extends DirectTest {
-// def code = ???
-//
-// def problemCode = """
-// package object A {
-// class B
-// object B
-// case class C()
-// }
-// """
-//
-// def compileProblemCode() = {
-// val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator")
-// compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(problemCode)
-// }
-//
-// def show() : Unit = {
-// for (i <- 0 until 2) {
-// compileProblemCode()
-// println(s"success ${i + 1}")
-// }
-// }
-//}
-
-package object A {
- // these should be prevented by the implementation restriction
- class B
- object B
- trait C
- object C
- case class D()
- // all the rest of these should be ok
- class E
- object F
- val g = "omg"
- var h = "wtf"
- def i = "lol"
- type j = String
- class K(val k : Int) extends AnyVal
- implicit class L(val l : Int)
-}
diff --git a/test/files/pos/t7126.scala b/test/files/pos/t7126.scala
new file mode 100644
index 0000000000..6720511e08
--- /dev/null
+++ b/test/files/pos/t7126.scala
@@ -0,0 +1,11 @@
+import language._
+
+object Test {
+ type T = Any
+ boom(???): Option[T] // SOE
+ def boom[CC[U]](t : CC[T]): Option[CC[T]] = None
+
+ // okay
+ foo(???): Option[Any]
+ def foo[CC[U]](t : CC[Any]): Option[CC[Any]] = None
+} \ No newline at end of file
diff --git a/test/files/pos/t7183.flags b/test/files/pos/t7183.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/t7183.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/t7183.scala b/test/files/pos/t7183.scala
new file mode 100644
index 0000000000..7647c1634b
--- /dev/null
+++ b/test/files/pos/t7183.scala
@@ -0,0 +1,13 @@
+class A
+object A {
+ def unapply(a: A): Some[A] = Some(a) // Change return type to Option[A] and the warning is gone
+}
+
+object Test {
+ for (A(a) <- List(new A)) yield a // spurious dead code warning.
+}
+
+// List(new A()).withFilter(((check$ifrefutable$2) => check$ifrefutable$2: @scala.unchecked match {
+// case A((a @ _)) => true
+// case _ => false // this is dead code, but it's compiler generated.
+// }))