summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2015-09-19 14:33:45 +1000
committerJason Zaugg <jzaugg@gmail.com>2015-09-19 18:41:52 +1000
commit581e2c2455524123ed259adcfc66817f7fc04726 (patch)
tree825e083e0fe7f9ed912e199dc783c350ef96377f /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent46c81c6be94152f8ecf3b9cfc27ca1bb393b46f1 (diff)
downloadscala-581e2c2455524123ed259adcfc66817f7fc04726.tar.gz
scala-581e2c2455524123ed259adcfc66817f7fc04726.tar.bz2
scala-581e2c2455524123ed259adcfc66817f7fc04726.zip
SI-9479 Fix regression w. inherited overloads in package object
One shouldn't base any decisions of the owner of an overloaded symbol. Instead, the owner of each of the alternatives should be considered. This gotcha is super easy to forget, as I did with my change to simplify the way we detect whether we need to add the `.package` prefix to a tree.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f26baf7d93..533ef13574 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -544,7 +544,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
tree match {
case Ident(_) =>
val packageObject =
- if (sym.owner.isModuleClass) sym.owner.sourceModule // historical optimization, perhaps no longer needed
+ if (!sym.isOverloaded && sym.owner.isModuleClass) sym.owner.sourceModule // historical optimization, perhaps no longer needed
else pre.typeSymbol.packageObject
Ident(packageObject)
case Select(qual, _) => Select(qual, nme.PACKAGEkw)