Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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.

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