diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-07-30 17:32:53 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-07-30 17:32:53 -0700 |
commit | 04536a37dc5af56f9be269163369a4bda53131ea (patch) | |
tree | 8ecf17cb086c62025e178d12effcbdd1a6094bb2 /src | |
parent | f429c64601ee1c9036eafe9e7ace9b941d24ed07 (diff) | |
parent | 2a14dd2d23e78775301d38dd235873e5cddc6e23 (diff) | |
download | scala-04536a37dc5af56f9be269163369a4bda53131ea.tar.gz scala-04536a37dc5af56f9be269163369a4bda53131ea.tar.bz2 scala-04536a37dc5af56f9be269163369a4bda53131ea.zip |
Merge pull request #1016 from hubertp/2.10.x-issue/5031
Fixed SI-5031. Only consider classes when looking for companion class.
Diffstat (limited to 'src')
-rwxr-xr-x | src/compiler/scala/tools/nsc/doc/model/IndexModelFactory.scala | 1 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 6 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/IndexModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/IndexModelFactory.scala index f4c96505a7..9d141efe0a 100755 --- a/src/compiler/scala/tools/nsc/doc/model/IndexModelFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/model/IndexModelFactory.scala @@ -8,7 +8,6 @@ package doc package model import scala.collection._ -import language.reflectiveCalls object IndexModelFactory { diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index 959d4d31ee..e6a9cb46c6 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -1760,7 +1760,6 @@ trait Symbols extends api.Symbols { self: SymbolTable => /** Is this symbol defined in the same scope and compilation unit as `that` symbol? */ def isCoDefinedWith(that: Symbol) = { - import language.reflectiveCalls (this.rawInfo ne NoType) && (this.effectiveOwner == that.effectiveOwner) && { !this.effectiveOwner.isPackageClass || @@ -2431,7 +2430,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => override def moduleClass = referenced override def companionClass = - flatOwnerInfo.decl(name.toTypeName).suchThat(_ isCoDefinedWith this) + flatOwnerInfo.decl(name.toTypeName).suchThat(sym => sym.isClass && (sym isCoDefinedWith this)) override def owner = { Statistics.incCounter(ownerCount) @@ -2796,7 +2795,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => */ protected final def companionModule0: Symbol = flatOwnerInfo.decl(name.toTermName).suchThat( - sym => sym.hasFlag(MODULE) && (sym isCoDefinedWith this) && !sym.isMethod) + sym => sym.isModule && (sym isCoDefinedWith this) && !sym.isMethod) override def companionModule = companionModule0 override def companionSymbol = companionModule0 @@ -3119,7 +3118,6 @@ trait Symbols extends api.Symbols { self: SymbolTable => } case class InvalidCompanions(sym1: Symbol, sym2: Symbol) extends Throwable({ - import language.reflectiveCalls "Companions '" + sym1 + "' and '" + sym2 + "' must be defined in same file:\n" + " Found in " + sym1.sourceFile.canonicalPath + " and " + sym2.sourceFile.canonicalPath }) { |