diff options
author | Som Snytt <som.snytt@gmail.com> | 2017-01-24 10:15:54 -0800 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2017-01-24 10:15:54 -0800 |
commit | a6dccebef268ace8151f38b3bac4a5b03f891d4c (patch) | |
tree | 2fb1dac820bdde0284c18b1363da095abe0aab79 /spec | |
parent | b9d4089d19ead36d07c2d6cdda283c9b678d515e (diff) | |
download | scala-a6dccebef268ace8151f38b3bac4a5b03f891d4c.tar.gz scala-a6dccebef268ace8151f38b3bac4a5b03f891d4c.tar.bz2 scala-a6dccebef268ace8151f38b3bac4a5b03f891d4c.zip |
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.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/05-classes-and-objects.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/05-classes-and-objects.md b/spec/05-classes-and-objects.md index 75620f57d4..86f1b6c4b0 100644 --- a/spec/05-classes-and-objects.md +++ b/spec/05-classes-and-objects.md @@ -597,10 +597,12 @@ overridden in subclasses. A `final` class may not be inherited by a template. `final` is redundant for object definitions. Members of final classes or objects are implicitly also final, so the `final` modifier is generally redundant for them, too. Note, however, that -[constant value definitions](04-basic-declarations-and-definitions.html#value-declarations-and-definitions) do require -an explicit `final` modifier, even if they are defined in a final class or -object. `final` may not be applied to incomplete members, and it may not be -combined in one modifier list with `sealed`. +[constant value definitions](04-basic-declarations-and-definitions.html#value-declarations-and-definitions) +do require an explicit `final` modifier, +even if they are defined in a final class or object. +`final` is permitted for abstract classes +but it may not be applied to traits or incomplete members, +and it may not be combined in one modifier list with `sealed`. ### `sealed` The `sealed` modifier applies to class definitions. A |