Skip to content

Conversation

@MarkTheHopeful
Copy link

Changed the subsubsection to be about all three modifiers instead just restating information about abstract (since neither open nor sealed are mentioned before chapter 5). Both abstract and sealed are mostly links to the corresponding subsubsections in the "Inheritance" chapter (5), however there is no specific part about the open modifier, despite it being used heavily in both text and examples of chapters 3 and 4.

Copy link
Contributor

@ice-phoenix ice-phoenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ice-phoenix ice-phoenix merged commit 6abcfff into Kotlin:develop Mar 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants