summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-15 07:21:26 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-09-15 07:21:26 -0700
commitc2f7ce5cbbc3ccd086764e49c47e139786e0ab24 (patch)
tree5779d4b901132c164a94e75f52916fb2cf3bdc92 /test/files/run
parentf3d9bdc283a82b816218aefc3df7d287e0cdd271 (diff)
parent27d73ee7a92d8dd10d4d0598a29d3a3657053995 (diff)
downloadscala-c2f7ce5cbbc3ccd086764e49c47e139786e0ab24.tar.gz
scala-c2f7ce5cbbc3ccd086764e49c47e139786e0ab24.tar.bz2
scala-c2f7ce5cbbc3ccd086764e49c47e139786e0ab24.zip
Merge pull request #2884 from retronym/ticket/3832
SI-1909 SI-3832 SI-7007 SI-7223 Improved handling of larval objects
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t1909.check3
-rw-r--r--test/files/run/t1909.scala12
-rw-r--r--test/files/run/t1909b.scala9
-rw-r--r--test/files/run/t1909c.scala9
-rw-r--r--test/files/run/t3832.scala17
-rw-r--r--test/files/run/t7223.check1
-rw-r--r--test/files/run/t7223.scala11
7 files changed, 62 insertions, 0 deletions
diff --git a/test/files/run/t1909.check b/test/files/run/t1909.check
new file mode 100644
index 0000000000..7d25be60fd
--- /dev/null
+++ b/test/files/run/t1909.check
@@ -0,0 +1,3 @@
+t1909.scala:7: warning: A try without a catch or finally is equivalent to putting its body in a block; no exceptions are handled.
+ def this(p: String) = this(try 0)
+ ^
diff --git a/test/files/run/t1909.scala b/test/files/run/t1909.scala
new file mode 100644
index 0000000000..8ead7bacf2
--- /dev/null
+++ b/test/files/run/t1909.scala
@@ -0,0 +1,12 @@
+// Until #1909 is fixed, if this compiles the bytecode
+// will trigger a VerifyError. This liftings and the one
+// in 1909b.scala actually happen in two different places
+// (uncurry and lambdalifter.)
+class Ticket1909 {
+ def this(value: Int) = this()
+ def this(p: String) = this(try 0)
+}
+
+object Test extends App {
+ new Ticket1909("")
+}
diff --git a/test/files/run/t1909b.scala b/test/files/run/t1909b.scala
new file mode 100644
index 0000000000..89b2af57dc
--- /dev/null
+++ b/test/files/run/t1909b.scala
@@ -0,0 +1,9 @@
+class Ticket1909 (x: Int) {
+ def this() = this({
+ def bar() = 5
+ bar
+ })
+}
+object Test extends App {
+ new Ticket1909()
+}
diff --git a/test/files/run/t1909c.scala b/test/files/run/t1909c.scala
new file mode 100644
index 0000000000..87c0eb08b5
--- /dev/null
+++ b/test/files/run/t1909c.scala
@@ -0,0 +1,9 @@
+class Base(a: Any)
+
+// java.lang.VerifyError: (class: Sub, method: <init> signature: ()V) Expecting to find object/array on stack
+// at Test$.<init>(t1909c.scala)
+class Sub() extends Base({ def bippy = 5; bippy })
+
+object Test extends App {
+ new Sub()
+}
diff --git a/test/files/run/t3832.scala b/test/files/run/t3832.scala
new file mode 100644
index 0000000000..ac44358bc7
--- /dev/null
+++ b/test/files/run/t3832.scala
@@ -0,0 +1,17 @@
+class t3832 {
+ def this(un: Int) = {
+ this()
+ def bippy = this
+ ()
+ }
+ def this(un: Boolean) = {
+ this()
+ def boppy = () => this
+ ()
+ }
+}
+
+object Test extends App {
+ new t3832(0)
+ new t3832(true)
+}
diff --git a/test/files/run/t7223.check b/test/files/run/t7223.check
new file mode 100644
index 0000000000..573541ac97
--- /dev/null
+++ b/test/files/run/t7223.check
@@ -0,0 +1 @@
+0
diff --git a/test/files/run/t7223.scala b/test/files/run/t7223.scala
new file mode 100644
index 0000000000..a707e957df
--- /dev/null
+++ b/test/files/run/t7223.scala
@@ -0,0 +1,11 @@
+class D(val a: () => Int => () => Any) {
+ a()(0)()
+}
+
+object Crash extends D(() => {
+ (x: Int) => {() => { new { println(x.toString) } }}
+})
+
+object Test extends App {
+ Crash
+}