Skip to content
New issue

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

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

Already on GitHub? # to your account

Clarification over constructors of enum entries #123

Open
wants to merge 1 commit into
base: release
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/src/md/kotlin.core/declarations.md
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,9 @@ Enum class $E$ is a special kind of class with the following properties:
> Note: for the purposes of overload resolution, enum entries are considered to be [static member callables][Call with an explicit type receiver] of the enum class type

Enum class body uses special kind of syntax (see grammar) to declare enum entries in addition to all other declarations inside the class body.
The name of each enum entry must be followed by the corresponding arguments for the enum class constructor;
except when no arguments are given, in that case the parentheses may be dropped.

Enum entries have their own bodies that may contain their own declarations, similar to [object declarations][Classifier declaration].

> Note: an enum class can have zero enum entries.
Expand Down