From: Jérémie Astor Date: Wed, 6 May 2020 16:33:32 +0000 (+0200) Subject: :bomb: Fix contains (self contains) X-Git-Tag: nightly~1655 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=eed3e3a7956930def9c649df6a37adb06d1096db;p=gwion.git :bomb: Fix contains (self contains) --- diff --git a/src/env/tupleform.c b/src/env/tupleform.c index 033365bf..511ed68a 100644 --- a/src/env/tupleform.c +++ b/src/env/tupleform.c @@ -22,9 +22,9 @@ ANN void tuple_info(const Env env, const Value v) { } ANN void tuple_contains(const Env env, const Value value) { - if(!env->class_def->e->tuple) - return; const Type t = value->type; + if(!env->class_def->e->tuple || env->class_def == value->type) + return; const Vector v = &env->class_def->e->tuple->contains; const m_int idx = vector_size(v) ? vector_find(v, (vtype)t) : -1; if(idx == -1) {