From eed3e3a7956930def9c649df6a37adb06d1096db Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 6 May 2020 18:33:32 +0200 Subject: [PATCH] :bomb: Fix contains (self contains) --- src/env/tupleform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.43.0