Summary
Grayscale supports implicit enum selectors (STANDARD.md §3.2.4) — the shorthand .VARIANT instead of EnumName.VARIANT when the expected enum type is known from context. The LSP has no awareness of this syntax.
Example
mut dir Direction = .NORTH
dir = .SOUTH
when dir {
is .NORTH { println("north") }
is .SOUTH { println("south") }
default { println("other") }
}
if dir == .WEST { println("west") }
do get_dir() -> Direction { return .NORTH }
mut c = Config{ dir: .EAST }
Scope
- Recognize
.VARIANT as valid syntax (no false diagnostics)
- Ideally provide completion for enum variants when a dot is typed in a context where an enum type is expected
- Awareness in
when/is branches, assignments, function arguments, return statements, struct literal fields, and comparisons
Summary
Grayscale supports implicit enum selectors (STANDARD.md §3.2.4) — the shorthand
.VARIANTinstead ofEnumName.VARIANTwhen the expected enum type is known from context. The LSP has no awareness of this syntax.Example
Scope
.VARIANTas valid syntax (no false diagnostics)when/isbranches, assignments, function arguments, return statements, struct literal fields, and comparisons