mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-21 11:54:27 -04:00
Fix nil comparisons for soa slices and dynamic arrays
This commit is contained in:
1 parent
3fd5c3cd85
commit
7fbe0a6f23
4 files changed
+49
-6
No files matched your search
@@ -1585,6 +1585,13 @@ bool type_has_nil(Type *t) {
|
||||
case Type_Union:
|
||||
return !t->Union.no_nil;
|
||||
case Type_Struct:
|
||||
if (is_type_soa_struct(t)) {
|
||||
switch (t->Struct.soa_kind) {
|
||||
case StructSoa_Fixed: return false;
|
||||
case StructSoa_Slice: return true;
|
||||
case StructSoa_Dynamic: return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case Type_Opaque:
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user