mirror of
https://github.com/odin-lang/Odin.git
synced 2026-05-25 05:09:53 +00:00
Allow assigning subtypes to unions
This commit is contained in:
@@ -891,7 +891,7 @@ gb_internal i64 check_distance_between_types(CheckerContext *c, Operand *operand
|
||||
if (score >= 0) {
|
||||
return score+2;
|
||||
}
|
||||
} else if (is_type_untyped(src)) {
|
||||
} else if (is_type_untyped(src) || is_type_struct(type_deref(src))) { // allow for subtyping of structs
|
||||
i64 prev_lowest_score = -1;
|
||||
i64 lowest_score = -1;
|
||||
for (Type *vt : dst->Union.variants) {
|
||||
|
||||
Reference in New Issue
Block a user