View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000162 | mercury | Bug | public | 2010-09-09 22:47 | 2022-10-11 16:43 | ||||||||
Reporter | pbone | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000162: No compiler error for a mode involving an instantation state that doesn't match the argument type. | ||||||||||||
Description | In 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(_) :- error("unimplemented"). | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
Notes | |
juliensf (administrator) 2022-10-11 16:43 |
If you declare what type the inst is for you will now get such an error: :- inst some_types_inst for some_type/0 ---> f1. (Since declaring the types for insts will eventually become the default, I don't think we need to do anything here.) |