aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-09-12 10:07:09 +0100
committergingerBill <bill@gingerbill.org>2024-09-12 10:07:09 +0100
commit3166c7bef921dcf48ac233738ec2064362bcbbd8 (patch)
treee85c46f89f008e51235cdd04b72fb1db6fed087d /src
parent275f1cc0de4cd60799b7080a50d9a93e40f186cc (diff)
Add `Suggested Example` for using an inline procedure which enables a target feature
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index f1bf86992..7f82fb58a 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -8087,7 +8087,10 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
GB_ASSERT(c->curr_proc_decl->entity->type->kind == Type_Proc);
String scope_features = c->curr_proc_decl->entity->type->Proc.enable_target_feature;
if (!check_target_feature_is_superset_of(scope_features, pt->Proc.enable_target_feature, &invalid)) {
+ ERROR_BLOCK();
error(call, "Inlined procedure enables target feature '%.*s', this requires the calling procedure to at least enable the same feature", LIT(invalid));
+
+ error_line("\tSuggested Example: @(enable_target_feature=\"%.*s\")\n", LIT(invalid));
}
}
}