summaryrefslogtreecommitdiff
path: root/test/files/run/static-annot-repl.scala
diff options
context:
space:
mode:
authorAleksandar Prokopec <axel22@gmail.com>2012-08-14 18:00:23 +0200
committerPaul Phillips <paulp@improving.org>2012-08-17 06:40:00 -0700
commit5a8dfad583b825158cf0abdae5d73a4a7f8cd997 (patch)
treeede2216c999babc5e10f9c364f22c7732c9b033f /test/files/run/static-annot-repl.scala
parente6c0439f1ca4270f28def98821def7b10ae84ec8 (diff)
downloadscala-5a8dfad583b825158cf0abdae5d73a4a7f8cd997.tar.gz
scala-5a8dfad583b825158cf0abdae5d73a4a7f8cd997.tar.bz2
scala-5a8dfad583b825158cf0abdae5d73a4a7f8cd997.zip
Fixes SI-6189.
Disable @static for the REPL code. The problem is that there are no companion classes generated for objects that contain the top-level declarations in the REPL. When there is no companion class, the selecting a @static field will translate to a getter call, instead of to a field load.
Diffstat (limited to 'test/files/run/static-annot-repl.scala')
-rw-r--r--test/files/run/static-annot-repl.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/files/run/static-annot-repl.scala b/test/files/run/static-annot-repl.scala
new file mode 100644
index 0000000000..1d2e9b2d7e
--- /dev/null
+++ b/test/files/run/static-annot-repl.scala
@@ -0,0 +1,22 @@
+
+
+
+import scala.tools.partest.ReplTest
+
+
+
+object Test extends ReplTest {
+ def code = """
+import annotation.static
+@static var x1 = 42
+@static val x2 = 43
+@static def x3 = 44
+x1
+x2
+x3
+class Test {
+ @static def x = 42
+}
+"""
+
+}