aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2025-01-13 09:15:11 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2025-01-13 09:15:11 +0200
commit164625327bd057141edf84339d4b43b2a8e2de24 (patch)
tree2557a51cff6389f135ee40b33e43de728ae862c7 /src
parent4dd30a1382b2dffa301e655962eafbf92b3b75f3 (diff)
downloadek-164625327bd057141edf84339d4b43b2a8e2de24.tar.gz
ek-164625327bd057141edf84339d4b43b2a8e2de24.zip
require that continuations have same publicity
Diffstat (limited to 'src')
-rw-r--r--src/actualize.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/actualize.c b/src/actualize.c
index a6155b9..9e36553 100644
--- a/src/actualize.c
+++ b/src/actualize.c
@@ -2441,6 +2441,21 @@ static int actualize_struct_cont(struct act_state *state,
struct scope *scope, struct ast *node)
{
assert(node->k == AST_STRUCT_CONT_DEF);
+ struct ast *base = chain_base(node);
+ assert(base);
+
+ /** @todo this is arguably kind of a hack to sidestep issues
+ * with 'which implementation of this trait should be used', but
+ * it kind of has some nice properties in and of itself, will
+ * have to think about this a bit more. */
+ if (ast_flags(node, AST_FLAG_PUBLIC) != ast_flags(base, AST_FLAG_PUBLIC)) {
+ /** @todo should the error report mention that this is possibly
+ * a temporary hack? */
+ semantic_error(scope->fctx, node, "different publicity flags than base");
+ semantic_info(scope->fctx, base, "previous here");
+ return -1;
+ }
+
struct ast *up = node->chain;
assert(up);