From 2324be56376aed8cd168e712001485f2202cdda6 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Sun, 16 Apr 2017 18:48:53 +0200 Subject: Fix constant type val value inline in constructors. --- tests/run/inline-constant-in-constructor-1.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/run/inline-constant-in-constructor-1.scala (limited to 'tests/run/inline-constant-in-constructor-1.scala') diff --git a/tests/run/inline-constant-in-constructor-1.scala b/tests/run/inline-constant-in-constructor-1.scala new file mode 100644 index 000000000..11a727fd6 --- /dev/null +++ b/tests/run/inline-constant-in-constructor-1.scala @@ -0,0 +1,15 @@ + + +abstract class A { + def s: Boolean = { println("s"); r } + def r: Boolean +} + +object Test extends A { + assert({ println("assert"); r == s }) // r constant type not replaced by true, r not initialized yet + override val r: true = { + println("r init") + true + } + def main(args: Array[String]): Unit = {} +} -- cgit v1.2.3