From ad3a5cb9bd896a06eb29ca1f3690731ce62f8765 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 10 Nov 2020 23:16:54 +0100 Subject: [PATCH] :art: Improve lambda tests --- src/emit/emit.c | 2 +- src/parse/check.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 526f237c..410b0b13 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -2045,7 +2045,7 @@ ANN static m_bool emit_fdef(const Emitter emit, const Func_Def fdef) { } static ANN int fdef_is_file_global(const Emitter emit, const Func_Def fdef) { - return isa(fdef->base->func->value_ref->type, emit->gwion->type[et_lambda]) < 0 && + return !fbflag(fdef->base, fbflag_lambda) && !emit->env->class_def && !GET_FLAG(fdef->base, global) && !fdef->base->tmpl && !emit->env->scope->depth; } diff --git a/src/parse/check.c b/src/parse/check.c index 07ffe748..c8d0b421 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -317,7 +317,7 @@ ANN static Type prim_id_non_res(const Env env, const Symbol *data) { } prim_self(data)->value = v; if(env->func) { - if(isa(env->func->value_ref->type, env->gwion->type[et_lambda]) > 0) + if(fbflag(env->func->def->base, fbflag_lambda)) check_upvalue(env, prim_self(data)); if(env->func && !GET_FLAG(v, const) && v->from->owner) unset_fflag(env->func, fflag_pure); -- 2.43.0