From 5634dcc1490de05dbf5b3f2637a7e0eb4be8d6d0 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 13 Sep 2014 16:37:06 +0200 Subject: Better TreeTypeMaps 1. They now keep track of changed constructors in templates, updating the class scope as for other members. 2. Any changed members are now entered into the new class scope at exactly the same position as the old one. That ensures that things like caseAccessors still work. 3. ChangeOwners now is reflected in the prefixes of any named types. 4. Newly created classes now get their own ClassInfo type. 5. TreeTypeMaps always crete "fresh" symbols. Fresh symbols do not share a NamedType reference with an existing reference to some other symbol. This obviates b2e0e7b4, which will be reverted. To make it work, the interface of TreeMap changed from an ownerMap function to a substitution-like data structure working with two lists. --- src/dotty/tools/dotc/core/Flags.scala | 6 +++++- 1 file changed, 5 insertions(+), 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 f89a5ce46..896de25fd 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -356,6 +356,9 @@ object Flags { // Flags following this one are not pickled + /** Symbol always defines a fresh named type */ + final val Fresh = commonFlag(45, "") + /** Symbol is defined in a super call */ final val InSuperCall = commonFlag(46, "") @@ -434,7 +437,8 @@ object Flags { final val FromStartFlags = AccessFlags | Module | Package | Deferred | MethodOrHKCommon | Param | ParamAccessor | Scala2ExistentialCommon | InSuperCall | Touched | Static | CovariantOrOuter | ContravariantOrLabel | ExpandedName | AccessorOrSealed | - CaseAccessorOrTypeArgument | Frozen | Erroneous | ImplicitCommon | Permanent | SelfNameOrImplClass + CaseAccessorOrTypeArgument | Fresh | Frozen | Erroneous | ImplicitCommon | Permanent | + SelfNameOrImplClass assert(FromStartFlags.isTermFlags && FromStartFlags.isTypeFlags) // TODO: Should check that FromStartFlags do not change in completion -- cgit v1.2.3