From: fennecdjay Date: Fri, 19 Jul 2019 14:00:05 +0000 (+0200) Subject: :art: Op fixes X-Git-Tag: nightly~2318 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=0a7c03e3265201eeafba1f452d9508c708c72061;p=gwion.git :art: Op fixes --- 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))