Skip to content

langref: incorrect use of the term "enum variant" in enums.zig #13847

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

Merged
merged 4 commits into from
Dec 13, 2022
Merged
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
6 changes: 3 additions & 3 deletions doc/langref.html.in
Original file line number Diff line number Diff line change
Expand Up @@ -3584,7 +3584,7 @@ const Type = enum {
not_ok,
};

// Declare a specific instance of the enum variant.
// Declare a specific enum field.
const c = Type.ok;

// If you want access to the ordinal value of an enum, you
Expand Down Expand Up @@ -3633,13 +3633,13 @@ test "enum method" {
try expect(!p.isClubs());
}

// An enum variant of different types can be switched upon.
// An enum can be switched upon.
const Foo = enum {
string,
number,
none,
};
test "enum variant switch" {
test "enum switch" {
const p = Foo.number;
const what_is_it = switch (p) {
Foo.string => "this is a string",
Expand Down