]> ocean-lang.org Git - ocean/blobdiff - csrc/oceani.mdc
oceani: propagate_type should return the found type, not what it was compatible with
[ocean] / csrc / oceani.mdc
index a62534814a880fd01aa9c78cdfce316edbb81a37..c80c99262004c6b39f82ca924e7e513fb3fddfaf 100644 (file)
@@ -2293,9 +2293,7 @@ correctly.
                        *perr |= Eruntime;
                if (v->constant)
                        *perr |= Econst;
-               if (!type)
-                       return v->type;
-               return type;
+               return v->type;
        }
 
 ###### interp exec cases
@@ -4803,7 +4801,8 @@ be declared at any time.
                        return Tnone;
 
                if (t) {
-                       if (propagate_types(b->right, c, perr_local, t, 0) != t)
+                       if (propagate_types(b->right, c, perr_local, t, 0) != t &&
+                           *perr_local & Efail)
                                if (b->left->type == Xvar)
                                        type_err(c, "info: variable '%v' was set as %1 here.",
                                                 cast(var, b->left)->var->where_set, t, rules, NULL);