diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-12 17:47:39 -0400 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-16 12:19:02 -0700 |
commit | 8ebfd48564c905624eecfc0efb51fd124c60c6a1 (patch) | |
tree | 75b80c7328d152b3f88cbe8664a5de80c726fc18 /src/compiler/scala/tools/nsc/Global.scala | |
parent | b27a31b87d5ae42a51ee026d3d4fa181249ec669 (diff) | |
download | scala-8ebfd48564c905624eecfc0efb51fd124c60c6a1.tar.gz scala-8ebfd48564c905624eecfc0efb51fd124c60c6a1.tar.bz2 scala-8ebfd48564c905624eecfc0efb51fd124c60c6a1.zip |
Testing compiler asSeenFrom directly.
It's more of a "dump what it says to a file so we'll know if
any of this ever changes" than a "test" per se. It could use
some wheat/chaff/nonsense/sense sorting. Still, it would
be great to have more stuff like this.
Diffstat (limited to 'src/compiler/scala/tools/nsc/Global.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index bc2cc8191c..9ccd0c28db 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -44,6 +44,8 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb with symtab.Positions { override def settings = currentSettings + + import definitions.{ findNamedMember, findMemberFromRoot } // alternate constructors ------------------------------------------ @@ -1494,21 +1496,6 @@ class Global(var currentSettings: Settings, var reporter: Reporter) extends Symb afterPhase(phase) { currentRun.units foreach (treePrinter.print(_)) } } - private def findMemberFromRoot(fullName: Name): Symbol = { - val segs = nme.segments(fullName.toString, fullName.isTermName) - if (segs.isEmpty) NoSymbol - else findNamedMember(segs.tail, definitions.RootClass.info member segs.head) - } - - private def findNamedMember(fullName: Name, root: Symbol): Symbol = { - val segs = nme.segments(fullName.toString, fullName.isTermName) - if (segs.isEmpty || segs.head != root.simpleName) NoSymbol - else findNamedMember(segs.tail, root) - } - private def findNamedMember(segs: List[Name], root: Symbol): Symbol = - if (segs.isEmpty) root - else findNamedMember(segs.tail, root.info member segs.head) - /** We resolve the class/object ambiguity by passing a type/term name. */ def showDef(fullName: Name, declsOnly: Boolean, ph: Phase) = { |