aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorftphikari <ftphikari@gmail.com>2022-04-15 19:16:52 +0300
committerGitHub <noreply@github.com>2022-04-15 19:16:52 +0300
commitde819cff94abe0da859cb08ed9035a3e57915164 (patch)
tree5de3ec7fcb0537c280133b8b4774a73784baf038 /src
parentcfae39c29d4c795c3236670bf7453f16d4b5b4cf (diff)
parent989641a6167498dfe6663fb330525d4d92becf8a (diff)
Merge branch 'odin-lang:master' into master
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp5
-rw-r--r--src/exact_value.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index dcf17af39..336a711d4 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -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;
}
diff --git a/src/exact_value.cpp b/src/exact_value.cpp
index f6df48951..cedef48c4 100644
--- a/src/exact_value.cpp
+++ b/src/exact_value.cpp
@@ -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);