Skip to content

Commit a6dcceb

Browse files
committed
SI-9464 Clarify spec on no final trait
Without being too finicky with syntax, say that `final abstract class` is OK (even as a nested class, where it would be an incomplete member) but not `final trait`. Such a class might be a standard lib primitive, or might be an implicit value that is only a ludicrous marker and, if present, need only have the null value.
1 parent b9d4089 commit a6dcceb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/05-classes-and-objects.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,12 @@ overridden in subclasses. A `final` class may not be inherited by
597597
a template. `final` is redundant for object definitions. Members
598598
of final classes or objects are implicitly also final, so the
599599
`final` modifier is generally redundant for them, too. Note, however, that
600-
[constant value definitions](04-basic-declarations-and-definitions.html#value-declarations-and-definitions) do require
601-
an explicit `final` modifier, even if they are defined in a final class or
602-
object. `final` may not be applied to incomplete members, and it may not be
603-
combined in one modifier list with `sealed`.
600+
[constant value definitions](04-basic-declarations-and-definitions.html#value-declarations-and-definitions)
601+
do require an explicit `final` modifier,
602+
even if they are defined in a final class or object.
603+
`final` is permitted for abstract classes
604+
but it may not be applied to traits or incomplete members,
605+
and it may not be combined in one modifier list with `sealed`.
604606

605607
### `sealed`
606608
The `sealed` modifier applies to class definitions. A

0 commit comments

Comments
 (0)