summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/GlobalSymbolLoaders.scala
blob: 69215482302b9fe81078607615b4b5303a038ca4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* NSC -- new Scala compiler
 * Copyright 2005-2013 LAMP/EPFL
 * @author  Martin Odersky
 */

package scala
package tools
package nsc

/**
 * Symbol loaders implementation that wires dependencies using Global.
 */
abstract class GlobalSymbolLoaders extends symtab.SymbolLoaders {
  val global: Global
  val symbolTable: global.type = global
  val platform: symbolTable.platform.type
  import global._
  def lookupMemberAtTyperPhaseIfPossible(sym: Symbol, name: Name): Symbol = {
    def lookup = sym.info.member(name)
    // if loading during initialization of `definitions` typerPhase is not yet set.
    // in that case we simply load the member at the current phase
    if (currentRun.typerPhase eq null)
      lookup
    else
      enteringTyper { lookup }
  }

  protected def compileLate(srcfile: io.AbstractFile): Unit =
    currentRun.compileLate(srcfile)
}