Mercury Bugs - mercury
View Issue Details
0000162mercuryBugpublic2010-09-09 22:472010-09-09 22:47
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000162: No compiler error for a mode involving an instantation state that doesn't match the argument type.
DescriptionIn the following code I expect to receive a compiler error telling me that the instantiation state that I'm trying to use is incorrect for the type that I'm using.

If the body of the predicate is more detailed and for example uses the empty list for the head variable then the compiler complains that the empty list doesn't match the instantiation state for the some_type type.

This is reproducible on taura (Linux x86-64, Mercury version rotd-2010-08-22, gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 with default compilation options (asm_fast.gc)

Additional Information:- module inst_state.

:- interface.

:- import_module list.

:- type some_type
    ---> f1
    ; f2.

:- inst some_types_inst
    ---> f1.

    % Note that I forget to wrap the inst in a list(I) inst so that it matches
    % the type.
:- pred some_pred(list(some_type)::out(some_types_inst)) is erroneous.

:- implementation.

:- import_module require.

some_pred(_) :-
TagsNo tags attached.
Attached Files

There are no notes attached to this issue.

Issue History
2010-09-09 22:47pboneNew Issue