Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ object Checking {
val mods = mdef.mods
def flagSourcePos(flag: FlagSet) =
mods.mods.find(_.flags == flag).getOrElse(mdef).srcPos
if mods.is(Open) then
report.error(ModifierNotAllowedForDefinition(Open), flagSourcePos(Open))
if mods.is(Abstract) then
report.error(ModifierNotAllowedForDefinition(Abstract), flagSourcePos(Abstract))
if mods.is(Sealed) then
Expand Down
1 change: 1 addition & 0 deletions tests/neg/i21760.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
open object O // error