We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
sealed
1 parent 6299785 commit 1d85ac7Copy full SHA for 1d85ac7
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1839,16 +1839,10 @@ object Parsers {
1839
val start = in.offset
1840
var mods = annotsAsMods()
1841
if (owner.isTypeName) {
1842
- mods = modifiers(start = mods)
+ // Adding ParamAccessor would crash
1843
+ mods = modifiers(start = mods, allowed = modifierTokens - SEALED) | ParamAccessor
1844
if (mods.is(Lazy))
1845
syntaxError("`lazy' modifier not allowed here. Use call-by-name parameters instead")
- mods =
1846
- if (mods.is(Sealed)) {
1847
- syntaxError("`sealed' modifier can be used only for classes")
1848
- mods // Adding ParamAccessor would crash
1849
- } else {
1850
- mods | ParamAccessor
1851
- }
1852
mods =
1853
atPos(start, in.offset) {
1854
if (in.token == VAL) {
0 commit comments