File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2319,11 +2319,12 @@ object Parsers {
2319
2319
2320
2320
def flagPos (flag : FlagSet ) = mods.mods.find(_.flags == flag).get.pos
2321
2321
if (mods is Abstract )
2322
- syntaxError(hl """ ${" abstract" } modifier cannot be used for objects """ , flagPos(Abstract ))
2323
- for (flag <- List (Sealed , Final )) {
2324
- if (mods is flag)
2325
- warning(hl """ $flag modifier is redundant for objects """ , source atPos flagPos(flag))
2326
- }
2322
+ syntaxError(hl """ ${Abstract } modifier cannot be used for objects """ , flagPos(Abstract ))
2323
+ if (mods is Sealed )
2324
+ syntaxError(hl """ ${Sealed } modifier is redundant for objects """ , flagPos(Sealed ))
2325
+ // XXX Make this an error.
2326
+ if (mods is Final )
2327
+ warning(hl """ ${Final } modifier is redundant for objects """ , source atPos flagPos(Final ))
2327
2328
2328
2329
ModuleDef (name, template).withMods(mods).setComment(in.getDocComment(start))
2329
2330
}
You can’t perform that action at this time.
0 commit comments