From 2d8691cfef92edf31da746668fd2da3c1fa5043c Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 12 Jan 2025 13:17:48 +0200 Subject: highlight flaws in current unification system --- src/actualize.c | 3 +++ src/debug.c | 9 +++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/actualize.c b/src/actualize.c index 2cb2f7a..a6155b9 100644 --- a/src/actualize.c +++ b/src/actualize.c @@ -2194,6 +2194,9 @@ static int actualize_trait(struct act_state *state, struct scope *scope, if (exists) continue; + if (analyze_visibility(trait_scope, n)) + return -1; + if (actualize_proc_sign(trait_scope, n)) return -1; } diff --git a/src/debug.c b/src/debug.c index 0908ee5..0e29efc 100644 --- a/src/debug.c +++ b/src/debug.c @@ -304,13 +304,14 @@ static void _type_str(FILE *fp, struct type *type) case TYPE_STRUCT: { struct ast *def = type->d; - if (struct_id(def)) { - fprintf(fp, "%s", struct_id(def)); + struct ast *base = chain_base(def); + if (struct_id(base)) { + fprintf(fp, "%s", struct_id(base)); } - if (struct_params(def)) { + if (struct_params(base)) { fprintf(fp, "!["); - _param_str(fp, struct_params(def)); + _param_str(fp, struct_params(base)); fprintf(fp, "]"); } break; -- cgit v1.3