Skip to content

Commit

Permalink
Tighten type of module to ModuleSymbol
Browse files Browse the repository at this point in the history
  • Loading branch information
adriaanm committed Oct 28, 2016
1 parent 47050ee commit 5c7b8ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
Expand Up @@ -65,7 +65,7 @@ abstract class SymbolLoaders {
enterIfNew(owner, clazz, completer)
}

def newModule(owner: Symbol, name: String): Symbol = owner.newModule(newTermName(name))
def newModule(owner: Symbol, name: String): ModuleSymbol = owner.newModule(newTermName(name))

/** Enter module with given `name` into scope of `root`
* and give them `completer` as type.
Expand Down Expand Up @@ -121,7 +121,7 @@ abstract class SymbolLoaders {
/** Enter class and module with given `name` into scope of `root`
* and give them `completer` as type.
*/
def enterClassAndModule(root: Symbol, name: String, getCompleter: (Symbol, Symbol) => SymbolLoader) {
def enterClassAndModule(root: Symbol, name: String, getCompleter: (Symbol, ModuleSymbol) => SymbolLoader) {
val clazz = newClass(root, name)
val module = newModule(root, name)
val completer = getCompleter(clazz, module)
Expand Down Expand Up @@ -281,7 +281,7 @@ abstract class SymbolLoaders {
}
}

class ClassfileLoader(val classfile: AbstractFile, clazz: Symbol, module: Symbol) extends SymbolLoader with FlagAssigningCompleter {
class ClassfileLoader(val classfile: AbstractFile, clazz: Symbol, module: ModuleSymbol) extends SymbolLoader with FlagAssigningCompleter {
private object classfileParser extends {
val symbolTable: SymbolLoaders.this.symbolTable.type = SymbolLoaders.this.symbolTable
} with ClassfileParser {
Expand Down
Expand Up @@ -56,7 +56,7 @@ abstract class ClassfileParser {
protected var file: AbstractFile = _ // the class file
protected var in: AbstractFileReader = _ // the class file reader
protected var clazz: Symbol = _ // the class symbol containing dynamic members
protected var staticModule: Symbol = _ // the module symbol containing static members
protected var staticModule: ModuleSymbol = _ // the module symbol containing static members
protected var instanceScope: Scope = _ // the scope of all instance definitions
protected var staticScope: Scope = _ // the scope of all static definitions
protected var pool: ThisConstantPool = _ // the classfile's constant pool
Expand Down Expand Up @@ -132,7 +132,7 @@ abstract class ClassfileParser {
finally loaders.parentsLevel -= 1
}

def parse(file: AbstractFile, clazz: Symbol, module: Symbol): Unit = {
def parse(file: AbstractFile, clazz: Symbol, module: ModuleSymbol): Unit = {
this.file = file
pushBusy(clazz) {
this.in = new AbstractFileReader(file)
Expand Down

0 comments on commit 5c7b8ed

Please sign in to comment.