@@ -454,8 +454,9 @@ object desugar {
454454 if (isCaseClass)
455455 ctx.error(CaseClassMissingParamList (cdef), namePos)
456456 ListOfNil
457- } else if (isCaseClass && originalVparamss.head.exists(_.mods.isOneOf(GivenOrImplicit ))) {
458- ctx.error(" Case classes should have a non-implicit parameter list" , namePos)
457+ }
458+ else if (isCaseClass && originalVparamss.head.exists(_.mods.isOneOf(GivenOrImplicit ))) {
459+ ctx.error(" Case classes should have a non-implicit parameter list" , namePos)
459460 ListOfNil
460461 }
461462 else originalVparamss.nestedMap(toDefParam(_, keepAnnotations = false ))
@@ -717,12 +718,11 @@ object desugar {
717718 }
718719 else if (companionMembers.nonEmpty || companionDerived.nonEmpty || isEnum)
719720 companionDefs(anyRef, companionMembers)
720- else if (isValueClass) {
721+ else if (isValueClass)
721722 impl.constr.vparamss match {
722723 case (_ :: Nil ) :: _ => companionDefs(anyRef, Nil )
723724 case _ => Nil // error will be emitted in typer
724725 }
725- }
726726 else Nil
727727
728728 enumCompanionRef match {
@@ -1129,12 +1129,11 @@ object desugar {
11291129 case tree : MemberDef =>
11301130 var tested : MemberDef = tree
11311131 def fail (msg : String ) = ctx.error(msg, tree.sourcePos)
1132- def checkApplicable (flag : Flag , test : MemberDefTest ): Unit = {
1132+ def checkApplicable (flag : Flag , test : MemberDefTest ): Unit =
11331133 if (tested.mods.is(flag) && ! test.applyOrElse(tree, (md : MemberDef ) => false )) {
11341134 fail(i " modifier ` ${flag.flagsString}` is not allowed for this definition " )
11351135 tested = tested.withMods(tested.mods.withoutFlags(flag))
11361136 }
1137- }
11381137 checkApplicable(Opaque , legalOpaque)
11391138 tested
11401139 case _ =>
0 commit comments