diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-03 15:06:02 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-03 15:18:23 -0800 |
commit | fb87f2de763e558c8639905ea8dfb447b5212cf7 (patch) | |
tree | 155b8fc90c1021ed67d5fe576eafb4a5a745797b /test/pending | |
parent | 61d34ed3fd61ab60ddea10445c737a3c9a6aa525 (diff) | |
download | scala-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.
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/run/t3702.scala | 10 | ||||
-rw-r--r-- | test/pending/run/t3705.scala | 17 | ||||
-rw-r--r-- | test/pending/run/t3832.scala | 7 | ||||
-rw-r--r-- | test/pending/run/t4098.scala | 9 | ||||
-rw-r--r-- | test/pending/run/t4415.scala | 86 | ||||
-rw-r--r-- | test/pending/run/t4460.scala | 12 |
6 files changed, 141 insertions, 0 deletions
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]) { } +} + |