[m-dev.] Why can't we pass a det pred where cc_multi is expected?

Ralph Becket rafe at cs.mu.OZ.AU
Wed Jul 6 13:42:04 AEST 2005


Consider

    :- module cc.
    :- implementation.
    
    :- pred p(pred(int)::(pred(out) is cc_multi), int::out) is cc_multi.
    
    p(P, X) :- P(X).
    
    :- pred q(int::out) is det.
    
    q(42).
    
    :- pred r(int::out) is cc_multi.
    
    r(X) :- p(q, X).

The compiler complains that

cc.m:001: Warning: interface for module `cc' does not export anything.
cc.m:014: In clause for `r(out)':
cc.m:014:   in argument 1 of call to predicate `cc.p/2':
cc.m:014:   mode error: variable `V_3' has instantiatedness `/* unique */(pred((free >> ground)) is det)',
cc.m:014:   expected instantiatedness was `(pred((free >> ground)) is cc_multi)'.
For more information, try recompiling with `-E'.

This seems odd to me.  Is this deliberate or just an oversight?

-- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list