aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-08-09 18:12:40 +0200
committerMartin Odersky <odersky@gmail.com>2014-08-10 18:04:09 +0200
commit96cd350429582ab22605064900f5ea6913aba80e (patch)
tree2f9efadfd92b146a23a1d8def34ed718a5752fe0
parent57c6c85cbc953a3489ee8d16bb5b7be862183924 (diff)
downloaddotty-96cd350429582ab22605064900f5ea6913aba80e.tar.gz
dotty-96cd350429582ab22605064900f5ea6913aba80e.tar.bz2
dotty-96cd350429582ab22605064900f5ea6913aba80e.zip
Module vals are lazy
Should have lazy flag set, otherwise forward reference checking would fail for modules. Note: LazyVals needed to be disabled because it also should transform module vals, but didn't do this so far because it only tested the Lazy flag. It turned out the module val transformation exposed some bugs in lazy vals in that LazyVals creates symbols as a side effect and enters them into scopes. Such mutations are allowed onyl in very specific cases (essentially only for local throw-away scopes).
-rw-r--r--src/dotty/tools/dotc/Compiler.scala2
-rw-r--r--src/dotty/tools/dotc/core/Flags.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/Compiler.scala b/src/dotty/tools/dotc/Compiler.scala
index c0ba622ce..a63a69b9b 100644
--- a/src/dotty/tools/dotc/Compiler.scala
+++ b/src/dotty/tools/dotc/Compiler.scala
@@ -26,7 +26,7 @@ class Compiler {
List(new ExtensionMethods),
List(new TailRec),
List(new PatternMatcher,
- new LazyValTranformContext().transformer,
+ // new LazyValTranformContext().transformer, // disabled, awaiting fixes
new Splitter),
List(new Nullarify,
new TypeTestsCasts,
diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala
index c527cef62..5931347b3 100644
--- a/src/dotty/tools/dotc/core/Flags.scala
+++ b/src/dotty/tools/dotc/core/Flags.scala
@@ -444,7 +444,7 @@ object Flags {
final val RetainedTypeArgFlags = VarianceFlags | ExpandedName | Protected | Local
/** Modules always have these flags set */
- final val ModuleCreationFlags = ModuleVal | Final | Stable
+ final val ModuleCreationFlags = ModuleVal | Lazy | Final | Stable
/** Module classes always have these flags set */
final val ModuleClassCreationFlags = ModuleClass | Final