diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/inline-constant-in-constructor-3.check | 4 | ||||
-rw-r--r-- | tests/run/inline-constant-in-constructor-3.scala | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/run/inline-constant-in-constructor-3.check b/tests/run/inline-constant-in-constructor-3.check new file mode 100644 index 000000000..b0171e3d9 --- /dev/null +++ b/tests/run/inline-constant-in-constructor-3.check @@ -0,0 +1,4 @@ +assert +r2 +s +r init diff --git a/tests/run/inline-constant-in-constructor-3.scala b/tests/run/inline-constant-in-constructor-3.scala new file mode 100644 index 000000000..621ace231 --- /dev/null +++ b/tests/run/inline-constant-in-constructor-3.scala @@ -0,0 +1,19 @@ + + +abstract class A { + def s: Boolean = { println("s"); r } + def r: Boolean +} + +object Test extends A { + assert({ println("assert"); r2 != s }) // s not initialized yet + def r2: true = { + println("r2") + true + } + override val r: true = { + println("r init") + true + } + def main(args: Array[String]): Unit = {} +} |