aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2022-04-14 15:09:03 +0100
committergingerBill <gingerBill@users.noreply.github.com>2022-04-14 15:09:03 +0100
commit8a9f7fc684b39c803cab184344a8a017308ed63a (patch)
tree28aea5b77a7a2b69f20dfb4d208e40b6828eab87 /src/check_expr.cpp
parent51db46551edb16eaa1396bbc3d8374dc1500154e (diff)
Fix #1713
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp5
1 files changed, 4 insertions, 1 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;
}