Summary
Grayscale supports tagged enums (STANDARD.md §3.2.4) — enum variants that carry associated data payloads. The LSP has no awareness of this feature.
Example
const Shape enum {
Circle(float)
Rect(float, float)
Point
}
mut s Shape = Shape.Circle(3.14)
when shape {
is Shape.Circle(radius) {
println("Circle with radius ${radius}")
}
is Shape.Rect(w, h) {
println("Rectangle ${w} x ${h}")
}
is Shape.Point {
println("Just a point")
}
}
Scope
- Update hover docs for
enum to mention tagged variants
- Symbol scanner should recognize variant payloads in enum declarations
- Awareness of destructuring patterns in
when/is blocks
Summary
Grayscale supports tagged enums (STANDARD.md §3.2.4) — enum variants that carry associated data payloads. The LSP has no awareness of this feature.
Example
Scope
enumto mention tagged variantswhen/isblocks