>>>Warning: Wong return type. >>>Warning: Expected: { mpz = object(implements _static_modules.Gmp()->mpz) }. >>>Warning: Got : object(is _static_modules.Gmp()->mpz) | mixed. >>> >>>Why is there a "| mixed" in this type? >> >>You probably need to add a tIfNot (or modifying the existing) for the >>generic case so that it doesn't match. > >I don't think I understand how this works. I thought tIfNot(A,B) meant >that if A doesn't match, attempt to match B. That would mean that the >return value of A is irrelevent, and tMix could never be the result, >as B always results in tFlt.
What you've missed is probably that typical efuns have types structured like: tOr(tFunc(...), tFunc(...), tFunc(...), // Special cases. tIfNot(tFunc(tNot(...):tZero), // Not any of the above. tFunc(tMixed:tMixed))) // Fallback case. If the filter for the fallback case isn't up to date, you will get a tMixed in the result in addition to the result from the special cases.