diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2016-10-28 20:49:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-28 20:49:19 +0200 |
commit | 066637781d42d8c512abaf7496e679e0e9f250e6 (patch) | |
tree | 3bd645a6fffbd7f8edb92598c45b4aab6fd3a896 /src/reflect/scala/reflect/internal/Symbols.scala | |
parent | 4a487ca5d0da7925fcd23772e25cc10d8167a351 (diff) | |
parent | 795d59a8f600e45ee9b05b483a4d80d2d8ce6de5 (diff) | |
download | scala-066637781d42d8c512abaf7496e679e0e9f250e6.tar.gz scala-066637781d42d8c512abaf7496e679e0e9f250e6.tar.bz2 scala-066637781d42d8c512abaf7496e679e0e9f250e6.zip |
Merge pull request #5482 from lrytz/sd248-frontend
Frontend fixes for scala-dev#248
Diffstat (limited to 'src/reflect/scala/reflect/internal/Symbols.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index f870ecfc15..8d77e334db 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -302,9 +302,9 @@ trait Symbols extends api.Symbols { self: SymbolTable => def newClassConstructor(pos: Position): MethodSymbol = newConstructor(pos) setInfo MethodType(Nil, this.tpe) - def newLinkedModule(clazz: Symbol, newFlags: Long = 0L): ModuleSymbol = { - val m = newModuleSymbol(clazz.name.toTermName, clazz.pos, MODULE | newFlags) - connectModuleToClass(m, clazz.asInstanceOf[ClassSymbol]) + def newLinkedModule(moduleClass: Symbol, newFlags: Long = 0L): ModuleSymbol = { + val m = newModuleSymbol(moduleClass.name.toTermName, moduleClass.pos, MODULE | newFlags) + connectModuleToClass(m, moduleClass.asInstanceOf[ClassSymbol]) } final def newModule(name: TermName, pos: Position = NoPosition, newFlags0: Long = 0L): ModuleSymbol = { val newFlags = newFlags0 | MODULE @@ -1063,7 +1063,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => // parent LowPriorityImplicits. See comment in c5441dc for more elaboration. // Since the fix for SI-7335 Predef parents must be defined in Predef.scala, and we should not // get here anymore. - devWarning(s"calling Symbol#exists with sourcefile based symbol loader may give incorrect results."); + devWarning(s"calling Symbol#exists with sourcefile based symbol loader may give incorrect results.") } rawInfo load this @@ -2223,7 +2223,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => * to the class. As presently implemented this potentially returns class for * any symbol except NoSymbol. */ - def companionClass: Symbol = flatOwnerInfo.decl(name.toTypeName).suchThat(_ isCoDefinedWith this) + def companionClass: Symbol = flatOwnerInfo.decl(name.toTypeName).suchThat(d => d.isClass && d.isCoDefinedWith(this)) /** For a class: the module or case class factory with the same name in the same package. * For all others: NoSymbol @@ -2860,8 +2860,6 @@ trait Symbols extends api.Symbols { self: SymbolTable => override def associatedFile_=(f: AbstractFile) { moduleClass.associatedFile = f } override def moduleClass = referenced - override def companionClass = - flatOwnerInfo.decl(name.toTypeName).suchThat(sym => sym.isClass && (sym isCoDefinedWith this)) override def owner = { if (Statistics.hotEnabled) Statistics.incCounter(ownerCount) |