>>>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.
  • The type of... Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
    • The ty... Henrik Grubbström (Lysator) @ Pike (-) developers forum
      • Th... Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum
        • ... Henrik Grubbstr�m (Lysator) @ Pike (-) developers forum
          • ... Martin Nilsson (Opera Mini - AFK!) @ Pike (-) developers forum

Reply via email to