From f804377891e49b5a219462c1bf0747355fb74469 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 27 Aug 2019 10:14:40 +0200 Subject: [PATCH] :bug: Fix nonnull --- src/parse/scanx.c | 4 +++- src/parse/type_decl.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parse/scanx.c b/src/parse/scanx.c index 1bcf1c51..5ef23120 100644 --- a/src/parse/scanx.c +++ b/src/parse/scanx.c @@ -56,7 +56,9 @@ scanx_ext(const Env e, const Class_Def c, const _exp_func f, void* d) { #undef scanx_parent __attribute__((returns_nonnull)) static inline Type get_type(const Type t) { - return !t->array_depth ? t : array_base(t); +// return !t->array_depth ? t : array_base(t); + const Type type = !t->array_depth ? t : array_base(t); + return !GET_FLAG(type, nonnull) ? type : type->e->parent; } __attribute__((returns_nonnull)) diff --git a/src/parse/type_decl.c b/src/parse/type_decl.c index 0d21cd66..cf704ace 100644 --- a/src/parse/type_decl.c +++ b/src/parse/type_decl.c @@ -25,6 +25,7 @@ ANN Type type_decl_resolve(const Env env, const Type_Decl* td) { if(exist) return exist; const Type t = type_copy(env->gwion->mp, ret); + t->e->parent = ret->e->parent; if(t->nspc) ADD_REF(t->nspc) t->name = s_name(sym); -- 2.43.0