mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-14 23:33:15 +00:00
Fix #1713
This commit is contained in:
@@ -8161,7 +8161,10 @@ ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast *node, Type *
|
||||
case Type_Basic: {
|
||||
if (!is_type_any(t)) {
|
||||
if (cl->elems.count != 0) {
|
||||
error(node, "Illegal compound literal");
|
||||
gbString s = type_to_string(t);
|
||||
error(node, "Illegal compound literal, %s cannot be used as a compound literal with fields", s);
|
||||
gb_string_free(s);
|
||||
is_constant = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -591,6 +591,7 @@ failure:
|
||||
i32 exact_value_order(ExactValue const &v) {
|
||||
switch (v.kind) {
|
||||
case ExactValue_Invalid:
|
||||
case ExactValue_Compound:
|
||||
return 0;
|
||||
case ExactValue_Bool:
|
||||
case ExactValue_String:
|
||||
@@ -607,8 +608,6 @@ i32 exact_value_order(ExactValue const &v) {
|
||||
return 6;
|
||||
case ExactValue_Procedure:
|
||||
return 7;
|
||||
// case ExactValue_Compound:
|
||||
// return 8;
|
||||
|
||||
default:
|
||||
GB_PANIC("How'd you get here? Invalid Value.kind %d", v.kind);
|
||||
|
||||
Reference in New Issue
Block a user