Possible resolution of KT-58964 (Consider moving content of section 5.1.2 (Sealed classes and interfaces) under section 4.1 (Declarations > Classifier declaration)) - #134
Merged
Conversation
ice-phoenix
requested changes
Mar 3, 2025
ice-phoenix
left a comment
Contributor
There was a problem hiding this comment.
In general, LGTM! Please rebase to the latest develop and fix the nitpicks, thanks!
| Class inheritance behaviour can be changed using modifiers, such as `open`, [`abstract`][Abstract classes] and [`sealed`][Sealed classes and interfaces]. | ||
|
|
||
| - Modifier `open` allows for a class to be inherited from. By default classes are [closed][Classifier type inheritance] (that is, they cannot be inherited from), one should add this modifier to change the behaviour. | ||
| - Modifier [`abstract`][Abstract classes] allows for a class to have members without implementation (that is, *abstract members*). Such classes *cannot* be instantiated directly; they are used as superclasses for other classes or objects. Abstract members should be implemented in a subtype of this abstract class. |
Contributor
There was a problem hiding this comment.
Suggested change
| - Modifier [`abstract`][Abstract classes] allows for a class to have members without implementation (that is, *abstract members*). Such classes *cannot* be instantiated directly; they are used as superclasses for other classes or objects. Abstract members should be implemented in a subtype of this abstract class. | |
| - Modifier [`abstract`][Abstract classes] allows for a class to have members without implementation (that is, *abstract members*). Such classes *cannot* be instantiated directly; they are used as superclasses for other classes or objects. Abstract members must be implemented in a non-abstract subtype of this abstract class. |
|
|
||
| - Modifier `open` allows for a class to be inherited from. By default classes are [closed][Classifier type inheritance] (that is, they cannot be inherited from), one should add this modifier to change the behaviour. | ||
| - Modifier [`abstract`][Abstract classes] allows for a class to have members without implementation (that is, *abstract members*). Such classes *cannot* be instantiated directly; they are used as superclasses for other classes or objects. Abstract members should be implemented in a subtype of this abstract class. | ||
| - Modifier [`sealed`][Sealed classes and interfaces] works similarly to the `abstract`, but for *sealed* classes inheritance is limited to the module it was defined in. |
Contributor
There was a problem hiding this comment.
Suggested change
| - Modifier [`sealed`][Sealed classes and interfaces] works similarly to the `abstract`, but for *sealed* classes inheritance is limited to the module it was defined in. | |
| - Modifier [`sealed`][Sealed classes and interfaces] works similarly to the `abstract` modifier, but for *sealed* classes inheritance is limited to the module it was defined in. |
MarkTheHopeful
force-pushed
the
kotlin-2.0/KT-58964
branch
from
March 5, 2025 09:00
65cfa53 to
6f0ee04
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed the subsubsection to be about all three modifiers instead just restating information about
abstract(since neitheropennorsealedare mentioned before chapter 5). Bothabstractandsealedare mostly links to the corresponding subsubsections in the "Inheritance" chapter (5), however there is no specific part about theopenmodifier, despite it being used heavily in both text and examples of chapters 3 and 4.