mirror of
https://github.com/odin-lang/Odin.git
synced 2026-07-11 02:19:30 +00:00
Fix #6874
This commit is contained in:
@@ -113,6 +113,7 @@ destroy_value :: proc(value: Value, allocator := context.allocator, loc := #call
|
||||
}
|
||||
|
||||
clone_value :: proc(value: Value, allocator := context.allocator) -> Value {
|
||||
value := value
|
||||
context.allocator = allocator
|
||||
|
||||
#partial switch &v in value {
|
||||
|
||||
@@ -1476,6 +1476,14 @@ gb_internal void check_type_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_
|
||||
return;
|
||||
}
|
||||
|
||||
if (switch_kind == TypeSwitch_Union) {
|
||||
if (is_addressed) {
|
||||
if (x.mode != Addressing_Variable && !is_type_pointer(x.type)) {
|
||||
error(lhs->Ident.token, "The element variable '%.*s' cannot be made addressable", LIT(lhs->Ident.token.string));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ast *nil_seen = nullptr;
|
||||
TypeSet seen = {};
|
||||
|
||||
Reference in New Issue
Block a user