diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2009-10-28 17:06:48 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2009-10-28 17:06:48 +0000 |
commit | cc934ee7bb181645d4436eb923f7eb843b7c259d (patch) | |
tree | c8bc73b1b74a56cc30fc60d8f0b5f01509228917 /test/files | |
parent | 03e717bdc79ddc2ad7a603698241fe39c9255a8a (diff) | |
download | scala-cc934ee7bb181645d4436eb923f7eb843b7c259d.tar.gz scala-cc934ee7bb181645d4436eb923f7eb843b7c259d.tar.bz2 scala-cc934ee7bb181645d4436eb923f7eb843b7c259d.zip |
Fix for #1909
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/bug1909.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug1909b.check | 6 | ||||
-rw-r--r-- | test/files/neg/bug1909b.scala | 3 | ||||
-rw-r--r-- | test/files/pos/bug1909.scala (renamed from test/files/neg/bug1909.scala) | 0 | ||||
-rw-r--r-- | test/files/pos/bug1909b.scala | 6 |
5 files changed, 11 insertions, 8 deletions
diff --git a/test/files/neg/bug1909.check b/test/files/neg/bug1909.check deleted file mode 100644 index 6ffbb4fccc..0000000000 --- a/test/files/neg/bug1909.check +++ /dev/null @@ -1,4 +0,0 @@ -bug1909.scala:7: error: Implementation restriction: auxiliary constructor calls may not use expressions which require lifting. - def this(p: String) = this(try 0) - ^ -one error found diff --git a/test/files/neg/bug1909b.check b/test/files/neg/bug1909b.check index d55c5e403b..e5de5fefe9 100644 --- a/test/files/neg/bug1909b.check +++ b/test/files/neg/bug1909b.check @@ -1,4 +1,4 @@ -bug1909b.scala:3: error: Implementation restriction: auxiliary constructor calls may not use expressions which require lifting. - def bar() = 5 - ^ +bug1909b.scala:4: error: this can be used only in a class, object, or template + def bar() = this.z + 5 + ^ one error found diff --git a/test/files/neg/bug1909b.scala b/test/files/neg/bug1909b.scala index b914bee366..6aa7870478 100644 --- a/test/files/neg/bug1909b.scala +++ b/test/files/neg/bug1909b.scala @@ -1,6 +1,7 @@ class Ticket1909 (x: Int) { + var z = 12 def this() = this({ - def bar() = 5 + def bar() = this.z + 5 bar }) }
\ No newline at end of file diff --git a/test/files/neg/bug1909.scala b/test/files/pos/bug1909.scala index 01213f62a3..01213f62a3 100644 --- a/test/files/neg/bug1909.scala +++ b/test/files/pos/bug1909.scala diff --git a/test/files/pos/bug1909b.scala b/test/files/pos/bug1909b.scala new file mode 100644 index 0000000000..b914bee366 --- /dev/null +++ b/test/files/pos/bug1909b.scala @@ -0,0 +1,6 @@ +class Ticket1909 (x: Int) { + def this() = this({ + def bar() = 5 + bar + }) +}
\ No newline at end of file |