From 0a7c03e3265201eeafba1f452d9508c708c72061 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 19 Jul 2019 16:00:05 +0200 Subject: [PATCH] :art: Op fixes --- src/lib/engine.c | 3 +++ src/lib/object.c | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/engine.c b/src/lib/engine.c index a3f498ad..2fe814f9 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -67,6 +67,9 @@ ANN static m_bool import_core_libs(const Gwi gwi) { GWI_OB((t_polar = gwi_mk_type(gwi, "polar", SZ_COMPLEX , NULL))) GWI_OB((t_vec3 = gwi_mk_type(gwi, "Vec3", SZ_VEC3, NULL))) GWI_OB((t_vec4 = gwi_mk_type(gwi, "Vec4", SZ_VEC4, NULL))) + GWI_BB(gwi_oper_ini(gwi, OP_ANY_TYPE, OP_ANY_TYPE, NULL)) + GWI_BB(gwi_oper_add(gwi, opck_basic_cast)) + GWI_BB(gwi_oper_end(gwi, "$", NULL)) GWI_BB(import_object(gwi)) GWI_OB((t_union = gwi_mk_type(gwi, "@Union", SZ_INT, t_object))) GWI_BB(gwi_class_ini(gwi, t_union, NULL, NULL)) diff --git a/src/lib/object.c b/src/lib/object.c index d9b3175c..a44c4531 100644 --- a/src/lib/object.c +++ b/src/lib/object.c @@ -99,7 +99,7 @@ describe_logical(Eq, ==) describe_logical(Neq, !=) static inline m_bool nonnull_check(const Type l, const Type r) { - return !GET_FLAG(l, nonnull) && GET_FLAG(r, nonnull); + return !GET_FLAG(r, nonnull) && GET_FLAG(l, nonnull); } static inline Type check_nonnull(const Env env, const Type l, const Type r, @@ -214,9 +214,6 @@ GWION_IMPORT(object) { GWI_BB(gwi_oper_add(gwi, at_object)) GWI_BB(gwi_oper_emi(gwi, opem_at_object)) GWI_BB(gwi_oper_end(gwi, "@=>", ObjectAssign)) - GWI_BB(gwi_oper_ini(gwi, OP_ANY_TYPE, OP_ANY_TYPE, NULL)) - GWI_BB(gwi_oper_add(gwi, opck_basic_cast)) - GWI_BB(gwi_oper_end(gwi, "$", NULL)) GWI_BB(gwi_oper_ini(gwi, "Object", "Object", "int")) GWI_BB(gwi_oper_end(gwi, "==", EqObject)) GWI_BB(gwi_oper_end(gwi, "!=", NeqObject)) -- 2.43.0