summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-03 15:06:02 -0800
committerPaul Phillips <paulp@improving.org>2012-03-03 15:18:23 -0800
commitfb87f2de763e558c8639905ea8dfb447b5212cf7 (patch)
tree155b8fc90c1021ed67d5fe576eafb4a5a745797b
parent61d34ed3fd61ab60ddea10445c737a3c9a6aa525 (diff)
downloadscala-fb87f2de763e558c8639905ea8dfb447b5212cf7.tar.gz
scala-fb87f2de763e558c8639905ea8dfb447b5212cf7.tar.bz2
scala-fb87f2de763e558c8639905ea8dfb447b5212cf7.zip
Test case closes SI-4777.
And pending tests for most of the other VerifyErrors which still fail to verify.
-rw-r--r--test/files/run/t4147.scala (renamed from test/files/run/si4147.scala)0
-rw-r--r--test/files/run/t4777.check2
-rw-r--r--test/files/run/t4777.scala8
-rw-r--r--test/files/run/t5171.check (renamed from test/files/run/si5171.check)0
-rw-r--r--test/files/run/t5171.scala (renamed from test/files/run/si5171.scala)0
-rw-r--r--test/files/run/t5262.check (renamed from test/files/run/si5262.check)0
-rw-r--r--test/files/run/t5262.scala (renamed from test/files/run/si5262.scala)0
-rw-r--r--test/files/run/t5374.check (renamed from test/files/run/si5374.check)0
-rw-r--r--test/files/run/t5374.scala (renamed from test/files/run/si5374.scala)0
-rw-r--r--test/files/run/t5375.check (renamed from test/files/run/si5375.check)0
-rw-r--r--test/files/run/t5375.scala (renamed from test/files/run/si5375.scala)0
-rw-r--r--test/files/run/t5380.scala (renamed from test/files/run/si5380.scala)0
-rw-r--r--test/pending/run/t3702.scala10
-rw-r--r--test/pending/run/t3705.scala17
-rw-r--r--test/pending/run/t3832.scala7
-rw-r--r--test/pending/run/t4098.scala9
-rw-r--r--test/pending/run/t4415.scala86
-rw-r--r--test/pending/run/t4460.scala12
18 files changed, 151 insertions, 0 deletions
diff --git a/test/files/run/si4147.scala b/test/files/run/t4147.scala
index c1e2d746a9..c1e2d746a9 100644
--- a/test/files/run/si4147.scala
+++ b/test/files/run/t4147.scala
diff --git a/test/files/run/t4777.check b/test/files/run/t4777.check
new file mode 100644
index 0000000000..11f1f59d43
--- /dev/null
+++ b/test/files/run/t4777.check
@@ -0,0 +1,2 @@
+28
+28
diff --git a/test/files/run/t4777.scala b/test/files/run/t4777.scala
new file mode 100644
index 0000000000..4a811d3b9a
--- /dev/null
+++ b/test/files/run/t4777.scala
@@ -0,0 +1,8 @@
+class A(val a: Int = 13)
+class DefaultsTest(x: Int = 25) extends A(28)
+object DefaultsTest extends DefaultsTest(12)
+
+object Test extends App {
+ println(new DefaultsTest() a)
+ println(DefaultsTest a)
+}
diff --git a/test/files/run/si5171.check b/test/files/run/t5171.check
index 159606d35c..159606d35c 100644
--- a/test/files/run/si5171.check
+++ b/test/files/run/t5171.check
diff --git a/test/files/run/si5171.scala b/test/files/run/t5171.scala
index eb8029df80..eb8029df80 100644
--- a/test/files/run/si5171.scala
+++ b/test/files/run/t5171.scala
diff --git a/test/files/run/si5262.check b/test/files/run/t5262.check
index 4c7a875de5..4c7a875de5 100644
--- a/test/files/run/si5262.check
+++ b/test/files/run/t5262.check
diff --git a/test/files/run/si5262.scala b/test/files/run/t5262.scala
index fc4e57aa96..fc4e57aa96 100644
--- a/test/files/run/si5262.scala
+++ b/test/files/run/t5262.scala
diff --git a/test/files/run/si5374.check b/test/files/run/t5374.check
index 6be88d77ec..6be88d77ec 100644
--- a/test/files/run/si5374.check
+++ b/test/files/run/t5374.check
diff --git a/test/files/run/si5374.scala b/test/files/run/t5374.scala
index 9b1671e795..9b1671e795 100644
--- a/test/files/run/si5374.scala
+++ b/test/files/run/t5374.scala
diff --git a/test/files/run/si5375.check b/test/files/run/t5375.check
index 7d3002ffda..7d3002ffda 100644
--- a/test/files/run/si5375.check
+++ b/test/files/run/t5375.check
diff --git a/test/files/run/si5375.scala b/test/files/run/t5375.scala
index e4b329deae..e4b329deae 100644
--- a/test/files/run/si5375.scala
+++ b/test/files/run/t5375.scala
diff --git a/test/files/run/si5380.scala b/test/files/run/t5380.scala
index 6083161a9b..6083161a9b 100644
--- a/test/files/run/si5380.scala
+++ b/test/files/run/t5380.scala
diff --git a/test/pending/run/t3702.scala b/test/pending/run/t3702.scala
new file mode 100644
index 0000000000..e08fc12e76
--- /dev/null
+++ b/test/pending/run/t3702.scala
@@ -0,0 +1,10 @@
+object Test {
+ def main(args: Array[String]) {
+ foo(Nil, Nil)
+ }
+
+ def foo(h: Any, t: List[Any]) = h match {
+ case 5 :: _ => ()
+ case List(from) => List(from, from, from)
+ }
+}
diff --git a/test/pending/run/t3705.scala b/test/pending/run/t3705.scala
new file mode 100644
index 0000000000..fcc020f28c
--- /dev/null
+++ b/test/pending/run/t3705.scala
@@ -0,0 +1,17 @@
+// package foo
+
+import scala.xml._
+object Test {
+ def updateNodes(ns: Seq[Node]): Seq[Node] =
+ for(subnode <- ns) yield subnode match {
+ case <d>{_}</d> if true => <d>abc</d>
+ case Elem(prefix, label, attribs, scope, children @ _*) =>
+ Elem(prefix, label, attribs, scope, updateNodes(children) : _*)
+ case other => other
+ }
+ def main(args: Array[String]): Unit = {
+ updateNodes(<b />)
+
+ }
+}
+
diff --git a/test/pending/run/t3832.scala b/test/pending/run/t3832.scala
new file mode 100644
index 0000000000..f081d5b3af
--- /dev/null
+++ b/test/pending/run/t3832.scala
@@ -0,0 +1,7 @@
+class Test {
+ def this(un: Int) = {
+ this()
+ def test(xs: List[Int]) = xs map (x => x)
+ ()
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/t4098.scala b/test/pending/run/t4098.scala
new file mode 100644
index 0000000000..b74ccf9bff
--- /dev/null
+++ b/test/pending/run/t4098.scala
@@ -0,0 +1,9 @@
+class A(a: Any) {
+ def this() = { this(b) ; def b = new {} }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ new A ("")
+ }
+}
diff --git a/test/pending/run/t4415.scala b/test/pending/run/t4415.scala
new file mode 100644
index 0000000000..f96031d650
--- /dev/null
+++ b/test/pending/run/t4415.scala
@@ -0,0 +1,86 @@
+/**
+ * Demonstration of issue with Extractors. If lines 15/16 are not present, get at runtime:
+ *
+ * Exception in thread "main" java.lang.VerifyError: (class: ExtractorIssue$$, method: convert signature: (LTopProperty;)LMyProp;) Accessing value from uninitialized register 5
+ * at ExtractorIssue.main(ExtractorIssue.scala)
+ * at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)]
+ *
+ * If lines 15/16 are present, the compiler crashes:
+ *
+ * fatal error (server aborted): not enough arguments for method body%3: (val p: MyProp[java.lang.String])MyProp[_33].
+ * Unspecified value parameter p.
+ */
+object Test {
+
+ def main(args: Array[String]) {
+ convert(new SubclassProperty)
+ }
+
+ def convert(prop: TopProperty): MyProp[_] = {
+ prop match {
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+ //case SubclassSecondMatch(p) => p // if these lines are present, the compiler crashes. If commented, unsafe byte
+ //case SecondMatch(p) => p // byte code is generated, which causes a java.lang.VerifyError at runtime
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+ case SubclassMatch(p) => p
+ case StandardMatch(p) => p
+ }
+ }
+}
+
+class TopProperty
+
+class StandardProperty extends TopProperty
+class SubclassProperty extends StandardProperty
+
+class SecondProperty extends TopProperty
+class SubclassSecondProperty extends StandardProperty
+
+trait MyProp[T]
+case class MyPropImpl[T] extends MyProp[T]
+
+object SubclassMatch {
+
+ def unapply(prop: SubclassProperty) : Option[MyProp[String]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : SubclassProperty = {
+ new SubclassProperty()
+ }
+}
+
+object StandardMatch {
+
+ def unapply(prop: StandardProperty) : Option[MyProp[String]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : StandardProperty = {
+ new StandardProperty()
+ }
+}
+
+object SubclassSecondMatch {
+
+ def unapply(prop: SubclassSecondProperty) : Option[MyProp[BigInt]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : SubclassSecondProperty = {
+ new SubclassSecondProperty()
+ }
+}
+
+object SecondMatch {
+
+ def unapply(prop: SecondProperty) : Option[MyProp[BigInt]] = {
+ Some(new MyPropImpl)
+ }
+
+ def apply(prop: MyProp[String]) : SecondProperty = {
+ new SecondProperty()
+ }
+} \ No newline at end of file
diff --git a/test/pending/run/t4460.scala b/test/pending/run/t4460.scala
new file mode 100644
index 0000000000..324e2f5bef
--- /dev/null
+++ b/test/pending/run/t4460.scala
@@ -0,0 +1,12 @@
+trait A
+
+class B(val x: Int) {
+ self: A =>
+
+ def this() = this()
+}
+
+object Test extends B(2) with A {
+ def main(args: Array[String]) { }
+}
+