From 96cd350429582ab22605064900f5ea6913aba80e Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 9 Aug 2014 18:12:40 +0200 Subject: 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). --- src/dotty/tools/dotc/core/Flags.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Flags.scala') 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 -- cgit v1.2.3