diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2006-11-02 15:12:06 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2006-11-02 15:12:06 +0000 |
commit | d433eb14c8a069f349979282b0acb71cedb43b49 (patch) | |
tree | 91221f505760c5cd53c4f6978288617661c892e6 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 2b3c8f9449bfd44375aa266035800c7b616aefbe (diff) | |
download | scala-d433eb14c8a069f349979282b0acb71cedb43b49.tar.gz scala-d433eb14c8a069f349979282b0acb71cedb43b49.tar.bz2 scala-d433eb14c8a069f349979282b0acb71cedb43b49.zip |
Some of these haven't changed, but SVN is too s...
Some of these haven't changed, but SVN is too stupid to care. Adding IDE
hooks to Global.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 581b1f9637..b01227da01 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -42,7 +42,9 @@ trait Namers requires Analyzer { mapOver(tp) } } - protected def doEnterValueParams = true; + /** overridden by IDE to not manually enter value parameters */ + protected final def doEnterValueParams = !inIDE; + protected def inIDE = false; class Namer(val context: Context) { @@ -196,8 +198,14 @@ trait Namers requires Analyzer { m } - def enterSyms(trees: List[Tree]): Namer = - (this /: trees) ((namer, tree) => namer.enterSym(tree)) + def enterSyms(trees: List[Tree]): Namer = { + var namer : Namer = this + for (val tree <- trees) { + val txt = namer.enterSym(tree) + if (!(txt eq namer.context)) namer = new Namer(txt) + } + namer + } def newTypeSkolems(tparams: List[Symbol]): List[Symbol] = { val tskolems = tparams map (.newTypeSkolem) @@ -220,7 +228,7 @@ trait Namers requires Analyzer { def deSkolemize: TypeMap = new DeSkolemizeMap(applicableTypeParams(context.owner)) - def enterSym(tree: Tree): Namer = { + def enterSym(tree: Tree): Context = { def finishWith(tparams: List[AbsTypeDef]): unit = { val sym = tree.symbol @@ -313,11 +321,11 @@ trait Namers requires Analyzer { case imp @ Import(_, _) => tree.symbol = NoSymbol.newImport(tree.pos) tree.symbol.setInfo(namerOf(tree.symbol).typeCompleter(tree)) - return new Namer(context.makeNewImport(imp)) + return (context.makeNewImport(imp)) case _ => } } - this + this.context } // --- Lazy Type Assignment -------------------------------------------------- |