Skip to content

Commit

Permalink
Merge pull request scala#5723 from dragos/issue/regression-assert-ide
Browse files Browse the repository at this point in the history
Fix regression introduced by 5751763
  • Loading branch information
lrytz committed Feb 24, 2017
2 parents f174bfb + e5c957e commit e2aaf2c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala
Expand Up @@ -122,11 +122,16 @@ abstract class SymbolLoaders {
* and give them `completer` as type.
*/
def enterClassAndModule(root: Symbol, name: String, getCompleter: (ClassSymbol, ModuleSymbol) => SymbolLoader) {
val clazz = newClass(root, name)
val module = newModule(root, name)
val completer = getCompleter(clazz, module)
enterClass(root, clazz, completer)
enterModule(root, module, completer)
val clazz0 = newClass(root, name)
val module0 = newModule(root, name)
val completer = getCompleter(clazz0, module0)
// enterClass/Module may return an existing symbol instead of the ones we created above
// this may happen when there's both sources and binaries on the classpath, but the class
// name is different from the file name, so the classpath can't match the binary and source
// representation. `companionModule/Class` prefers the source version, so we should be careful
// to reuse the symbols returned below.
val clazz = enterClass(root, clazz0, completer)
val module = enterModule(root, module0, completer)
if (!clazz.isAnonymousClass) {
// Diagnostic for SI-7147
def msg: String = {
Expand Down

0 comments on commit e2aaf2c

Please sign in to comment.