summaryrefslogtreecommitdiff
path: root/src/compiler/scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-10-28 10:27:13 -0700
committerSom Snytt <som.snytt@gmail.com>2016-10-31 22:30:16 -0700
commit4959e9f11c459e1c1eaa6cc168a4b9f2e784ffdf (patch)
treee070f4a89d557551f73da5c362a689df3e4c87ee /src/compiler/scala
parent9e1de6ee81e9eaf9d8ac59446bc97c79b5ff0cb6 (diff)
downloadscala-4959e9f11c459e1c1eaa6cc168a4b9f2e784ffdf.tar.gz
scala-4959e9f11c459e1c1eaa6cc168a4b9f2e784ffdf.tar.bz2
scala-4959e9f11c459e1c1eaa6cc168a4b9f2e784ffdf.zip
SI-6734 Comment
Diffstat (limited to 'src/compiler/scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index a92c190805..cca6f280e3 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -3140,13 +3140,14 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
// SI-5877 The decls of a package include decls of the package object. But we don't want to add
// the corresponding synthetics to the package class, only to the package object class.
// SI-6734 Locality test below is meaningless if we're not even in the correct tree.
+ // For modules that are synthetic case companions, check that case class is defined here.
def shouldAdd(sym: Symbol): Boolean = {
def shouldAddAsModule: Boolean =
sym.moduleClass.attachments.get[ClassForCaseCompanionAttachment] match {
case Some(att) =>
val cdef = att.caseClass
stats.exists {
- case t @ ClassDef(_, _, _, _) => t.symbol == cdef.symbol
+ case t @ ClassDef(_, _, _, _) => t.symbol == cdef.symbol // cdef ne t
case _ => false
}
case _ => true