diff options
author | Paul Phillips <paulp@improving.org> | 2009-10-22 21:09:57 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-10-22 21:09:57 +0000 |
commit | 99dae57ebb9204a8c99d063fa0666247134d109d (patch) | |
tree | 51c197a601baaafe6d91f94a9bb45849d0c49f0d /test | |
parent | a074b273122896f4e89d1d4c6dd80ebfb325a5cc (diff) | |
download | scala-99dae57ebb9204a8c99d063fa0666247134d109d.tar.gz scala-99dae57ebb9204a8c99d063fa0666247134d109d.tar.bz2 scala-99dae57ebb9204a8c99d063fa0666247134d109d.zip |
Tickets #1909 and #2508 involve code which comp...
Tickets #1909 and #2508 involve code which compiles but then fails at
runtime due to invalid bytecode. This commit turns those into compile
time errors. Includes negative test case.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/bug1909.check | 4 | ||||
-rw-r--r-- | test/files/neg/bug1909.scala | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/files/neg/bug1909.check b/test/files/neg/bug1909.check new file mode 100644 index 0000000000..631c60d5f0 --- /dev/null +++ b/test/files/neg/bug1909.check @@ -0,0 +1,4 @@ +bug1909.scala:5: 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/bug1909.scala b/test/files/neg/bug1909.scala new file mode 100644 index 0000000000..4fae4e5414 --- /dev/null +++ b/test/files/neg/bug1909.scala @@ -0,0 +1,6 @@ +// Until #1909 is fixed, if this compiles the bytecode +// will trigger a VerifyError. +class Class { + def this(value: Int) = this() + def this(p: String) = this(try 0) +}
\ No newline at end of file |