aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorodersky <odersky@gmail.com>2017-02-02 16:40:45 +1100
committerGitHub <noreply@github.com>2017-02-02 16:40:45 +1100
commit1bbc632868695c061a3a7fd5de7abc0b4dd25636 (patch)
treea5f641ac2c32fdb5d86341eadca58767cd223d55 /compiler/src/dotty/tools/dotc/typer/Namer.scala
parent64332a794c05cbf21491eaf0bfdf4482a80b1b10 (diff)
parent33ee93abd302fb30b040c52551650e0a4bba61e7 (diff)
downloaddotty-1bbc632868695c061a3a7fd5de7abc0b4dd25636.tar.gz
dotty-1bbc632868695c061a3a7fd5de7abc0b4dd25636.tar.bz2
dotty-1bbc632868695c061a3a7fd5de7abc0b4dd25636.zip
Merge pull request #1929 from dotty-staging/multi-level
support pre-typer transform of trees
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Namer.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Namer.scala b/compiler/src/dotty/tools/dotc/typer/Namer.scala
index 6bd8f6d06..1672512a7 100644
--- a/compiler/src/dotty/tools/dotc/typer/Namer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Namer.scala
@@ -498,7 +498,9 @@ class Namer { typer: Typer =>
}
for (mdef @ ModuleDef(name, _) <- stats if !mdef.mods.is(Flags.Package)) {
val typName = name.toTypeName
- val Thicket(vdef :: (mcls @ TypeDef(_, impl: Template)) :: Nil) = mdef.attachment(ExpandedTree)
+ // Expansion of object is a flattened thicket with the first two elements being:
+ // module val :: module class :: rest
+ val Thicket(vdef :: (mcls @ TypeDef(_, impl: Template)) :: rest) = expanded(mdef)
moduleDef(typName) = mcls
classDef get name.toTypeName match {
case Some(cdef) =>
@@ -506,7 +508,7 @@ class Namer { typer: Typer =>
case Thicket(cls :: mval :: TypeDef(_, compimpl: Template) :: crest) =>
val mcls1 = cpy.TypeDef(mcls)(
rhs = cpy.Template(impl)(body = compimpl.body ++ impl.body))
- mdef.putAttachment(ExpandedTree, Thicket(vdef :: mcls1 :: Nil))
+ mdef.putAttachment(ExpandedTree, Thicket(vdef :: mcls1 :: rest))
moduleDef(typName) = mcls1
cdef.putAttachment(ExpandedTree, Thicket(cls :: crest))
case _ =>