diff options
author | Paul Phillips <paulp@improving.org> | 2012-07-26 10:16:29 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-07-26 10:19:41 -0700 |
commit | b79c7600544db9964c228b94a2f70f3ed854f89b (patch) | |
tree | 4311fe4c11416e919892d06ae568352e6ad24d0a /test/files | |
parent | fe513d1f147e60988414b01e5928811bb6f78714 (diff) | |
download | scala-b79c7600544db9964c228b94a2f70f3ed854f89b.tar.gz scala-b79c7600544db9964c228b94a2f70f3ed854f89b.tar.bz2 scala-b79c7600544db9964c228b94a2f70f3ed854f89b.zip |
Removed restriction on final vars, SI-2418.
The original fix for SI-2418 excluded final vars entirely, but
the problem was not final vars per se, but the emission of ACC_FINAL
in combination with ACC_VOLATILE. Since vars never get ACC_FINAL
now, this is no longer an issue.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/run/t2418.check | 1 | ||||
-rw-r--r-- | test/files/run/t2418.scala | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/t2418.check b/test/files/run/t2418.check new file mode 100644 index 0000000000..f599e28b8a --- /dev/null +++ b/test/files/run/t2418.check @@ -0,0 +1 @@ +10 diff --git a/test/files/run/t2418.scala b/test/files/run/t2418.scala new file mode 100644 index 0000000000..f330bef60a --- /dev/null +++ b/test/files/run/t2418.scala @@ -0,0 +1,10 @@ +class Foo { + @volatile final var x=10 + override def toString = "" + x +} + +object Test { + def main(args: Array[String]): Unit = { + println((new Foo)) + } +} |