diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-04-16 18:48:53 +0200 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2017-04-16 18:48:53 +0200 |
commit | 2324be56376aed8cd168e712001485f2202cdda6 (patch) | |
tree | 46ccb7fdd77e94f235a5defb93b13f0c38c37015 /tests/run/inline-constant-in-constructor-1.scala | |
parent | a370eed7bebbc534e19de7dadefd72a70349854f (diff) | |
download | dotty-2324be56376aed8cd168e712001485f2202cdda6.tar.gz dotty-2324be56376aed8cd168e712001485f2202cdda6.tar.bz2 dotty-2324be56376aed8cd168e712001485f2202cdda6.zip |
Fix constant type val value inline in constructors.
Diffstat (limited to 'tests/run/inline-constant-in-constructor-1.scala')
-rw-r--r-- | tests/run/inline-constant-in-constructor-1.scala | 15 |
1 files changed, 15 insertions, 0 deletions
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 = {} +} |