@@ -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 {
@@ -1133,12 +1133,11 @@ object desugar {
11331133 case tree : MemberDef =>
11341134 var tested : MemberDef = tree
11351135 def fail (msg : String ) = ctx.error(msg, tree.sourcePos)
1136- def checkApplicable (flag : Flag , test : MemberDefTest ): Unit = {
1136+ def checkApplicable (flag : Flag , test : MemberDefTest ): Unit =
11371137 if (tested.mods.is(flag) && ! test.applyOrElse(tree, (md : MemberDef ) => false )) {
11381138 fail(i " modifier ` ${flag.flagsString}` is not allowed for this definition " )
11391139 tested = tested.withMods(tested.mods.withoutFlags(flag))
11401140 }
1141- }
11421141 checkApplicable(Opaque , legalOpaque)
11431142 tested
11441143 case _ =>
0 commit comments