diff options
author | James Iry <jamesiry@gmail.com> | 2013-02-08 07:34:11 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-02-08 07:34:11 -0800 |
commit | c0d1bc4cc4cb2958af69305d286ff684306617a5 (patch) | |
tree | af67a07ac877e3e34fa4e227bf48786d300352d9 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | abc87e25d9a8030ed65677df9b41f302025c1717 (diff) | |
parent | 81fa8316092e295c1a893b6fcf65568c11fffb58 (diff) | |
download | scala-c0d1bc4cc4cb2958af69305d286ff684306617a5.tar.gz scala-c0d1bc4cc4cb2958af69305d286ff684306617a5.tar.bz2 scala-c0d1bc4cc4cb2958af69305d286ff684306617a5.zip |
Merge pull request #2017 from retronym/ticket/6666
Booking more progress on SI-6666
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index ab338447c9..341dbfbe1f 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -134,9 +134,12 @@ trait Namers extends MethodSynthesis { def setPrivateWithin(tree: MemberDef, sym: Symbol): Symbol = setPrivateWithin(tree, sym, tree.mods) - def inConstructorFlag: Long = - if (owner.isConstructor && !context.inConstructorSuffix || owner.isEarlyInitialized) INCONSTRUCTOR - else 0l + def inConstructorFlag: Long = { + val termOwnedContexts: List[Context] = context.enclosingContextChain.takeWhile(_.owner.isTerm) + val constructorNonSuffix = termOwnedContexts exists (c => c.owner.isConstructor && !c.inConstructorSuffix) + val earlyInit = termOwnedContexts exists (_.owner.isEarlyInitialized) + if (constructorNonSuffix || earlyInit) INCONSTRUCTOR else 0L + } def moduleClassFlags(moduleFlags: Long) = (moduleFlags & ModuleToClassFlags) | inConstructorFlag |