diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-16 11:12:44 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 13:05:27 +0200 |
commit | dbd8457e441bda6a444efd19b5eb1eaec373a535 (patch) | |
tree | 13406003f3b0e2f54d9f1b05139ee9dc35a7291e /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 78e7ebab7d8acce2632c7ba6a63546cc174e1467 (diff) | |
download | scala-dbd8457e441bda6a444efd19b5eb1eaec373a535.tar.gz scala-dbd8457e441bda6a444efd19b5eb1eaec373a535.tar.bz2 scala-dbd8457e441bda6a444efd19b5eb1eaec373a535.zip |
SI-7345 Produce Context#imports from the context chain
Rather than keeping a List[ImportInfo] around as a field.
This sort of change reduces our bug exposure by structurally
enforcing the invariant that `Context#imports` must mirror
the `outer` chain.
This entails changing a few elements of Contexts from mutable
vars to constructor pararameters, which seems desirable anyway.
We no longer need `makeNewImport`, as `make` now inspects
the provided tree and determines does import specific things
(tracking of used imports / mixin of ImportContext) when
appropriate.
The only wrinkle in this commit is the unfortunate need to pass
`owner = null` in the extends clause of NoContext. I don't see
cleaner way around this.
Applied minor rework to `implicitss` to avoid needlessly re-evaluating
`imports` and `nextOuter`.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index bbb1dbe8d8..e4bfa9d66a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -253,7 +253,7 @@ trait Namers extends MethodSynthesis { case DocDef(_, defn) => enterSym(defn) case tree @ Import(_, _) => assignSymbol(tree) - returnContext = context.makeNewImport(tree) + returnContext = context.make(tree) case _ => } returnContext |