mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-07 05:32:50 -04:00
union #shared_nil
This adds a feature to `union` which requires all the variants to have a `nil` value and on assign to the union, checks whether that value is `nil` or not. If the value is `nil`, the union will be `nil` (thus sharing the `nil` value)
This commit is contained in:
1 parent
3e66eec735
commit
3f935bea25
10 files changed
+104
-32
No files matched your search
@@ -136,6 +136,7 @@ Type_Info_Union :: struct {
|
||||
custom_align: bool,
|
||||
no_nil: bool,
|
||||
maybe: bool,
|
||||
shared_nil: bool,
|
||||
}
|
||||
Type_Info_Enum :: struct {
|
||||
base: ^Type_Info,
|
||||
|
||||
Reference in new issue
Block a user