summaryrefslogtreecommitdiff
path: root/test/files/run/t4742.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t4742.scala')
-rw-r--r--test/files/run/t4742.scala7
1 files changed, 7 insertions, 0 deletions
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)
+}