@@ -454,8 +454,9 @@ object desugar {
454
454
if (isCaseClass)
455
455
ctx.error(CaseClassMissingParamList (cdef), namePos)
456
456
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)
459
460
ListOfNil
460
461
}
461
462
else originalVparamss.nestedMap(toDefParam(_, keepAnnotations = false ))
@@ -717,12 +718,11 @@ object desugar {
717
718
}
718
719
else if (companionMembers.nonEmpty || companionDerived.nonEmpty || isEnum)
719
720
companionDefs(anyRef, companionMembers)
720
- else if (isValueClass) {
721
+ else if (isValueClass)
721
722
impl.constr.vparamss match {
722
723
case (_ :: Nil ) :: _ => companionDefs(anyRef, Nil )
723
724
case _ => Nil // error will be emitted in typer
724
725
}
725
- }
726
726
else Nil
727
727
728
728
enumCompanionRef match {
@@ -1133,12 +1133,11 @@ object desugar {
1133
1133
case tree : MemberDef =>
1134
1134
var tested : MemberDef = tree
1135
1135
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 =
1137
1137
if (tested.mods.is(flag) && ! test.applyOrElse(tree, (md : MemberDef ) => false )) {
1138
1138
fail(i " modifier ` ${flag.flagsString}` is not allowed for this definition " )
1139
1139
tested = tested.withMods(tested.mods.withoutFlags(flag))
1140
1140
}
1141
- }
1142
1141
checkApplicable(Opaque , legalOpaque)
1143
1142
tested
1144
1143
case _ =>
0 commit comments