summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-09-24 12:55:38 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-09-24 12:55:38 -0700
commitbda48577d022811be58ce2b7f9e46890543ad45b (patch)
tree3c607afd72ad08ddf37895a799a5c3bb51ac38ff /test/files/run
parentc9fdcec4577932d001a865a7f6606c6e59f58cd3 (diff)
parentfa271e24342831bb6d7b683fddd1a4a11825d39d (diff)
downloadscala-bda48577d022811be58ce2b7f9e46890543ad45b.tar.gz
scala-bda48577d022811be58ce2b7f9e46890543ad45b.tar.bz2
scala-bda48577d022811be58ce2b7f9e46890543ad45b.zip
Merge pull request #2982 from retronym/topic/checkinit
SI-4742 Make -Xcheckinit aware of constants.
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/t4742.flags1
-rw-r--r--test/files/run/t4742.scala7
2 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/t4742.flags b/test/files/run/t4742.flags
new file mode 100644
index 0000000000..ae08446055
--- /dev/null
+++ b/test/files/run/t4742.flags
@@ -0,0 +1 @@
+-Xcheckinit \ No newline at end of file
diff --git a/test/files/run/t4742.scala b/test/files/run/t4742.scala
new file mode 100644
index 0000000000..3b42c0c120
--- /dev/null
+++ b/test/files/run/t4742.scala
@@ -0,0 +1,7 @@
+trait T { val x: Int = 0 }
+object O extends T { override final val x = 1 }
+
+object Test extends App {
+ // was throwing an UnitializedFieldError as constant 1 is folded into the accessor
+ assert((O: T).x == 1)
+}