add implicit cast for enum literal to optionals and error unions #2811
Labels
accepted
This proposal is planned.
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
stage1
The process of building from source via WebAssembly and the C backend.
Milestone
For example, the following does not compile today:
The error is:
For this to work today you need to specify the enum type with
foo = Foo.A
.This is simply proposing to check the inner type of a nullable in the compiler and support performing enum literal inference based on that.
The text was updated successfully, but these errors were encountered: