From: fennecdjay Date: Tue, 27 Aug 2019 08:14:40 +0000 (+0200) Subject: :bug: Fix nonnull X-Git-Tag: nightly~2258 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=f804377891e49b5a219462c1bf0747355fb74469;p=gwion.git :bug: Fix nonnull --- 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);