aboutsummaryrefslogtreecommitdiff
path: root/src/check_type.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-14 12:44:13 +0100
committergingerBill <bill@gingerbill.org>2024-07-14 12:44:13 +0100
commit3533094cc2fc8cae8229b9887efae4541ccd278b (patch)
tree90e61fb942229fee838692013deb8f9720bc7a78 /src/check_type.cpp
parent5ce6676914f5daadf42613574d4700c2750275de (diff)
Restrict `#no_capture` to pointer-like types only
Diffstat (limited to 'src/check_type.cpp')
-rw-r--r--src/check_type.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index 7b75bf503..d0dddb62b 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -2071,13 +2071,9 @@ gb_internal Type *check_get_params(CheckerContext *ctx, Scope *scope, Ast *_para
} else {
if (is_type_internally_pointer_like(type)) {
// okay
- } else if (is_type_slice(type) || is_type_string(type)) {
- // okay
- } else if (is_type_dynamic_array(type)) {
- // okay
} else {
ERROR_BLOCK();
- error(name, "'#no_capture' can only be applied to pointer-like types, slices, strings, and dynamic arrays");
+ error(name, "'#no_capture' can only be applied to pointer-like types");
error_line("\t'#no_capture' does not currently do anything useful\n");
p->flags &= ~FieldFlag_no_capture;
}