Mercury Bugs - mercury
View Issue Details
0000574mercuryBugpublic2024-05-06 00:352024-05-06 00:46
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000574: Higher-order inst gets lost when using combined higher-order type and inst
DescriptionThe attached program is a very cut-down version of a problem reported by a user on twitter.
Compiling the attached results in:

     bug574.m:017: In clause for `process_job(in, di, uo)':
     bug574.m:017: in argument 1 of call to predicate `bug574.do_process_job1'/3:
     bug574.m:017: mode error: variable `Pred' has instantiatedness `ground',
     bug574.m:017: expected instantiatedness was `(pred(in, di, uo) is det)'.

I can see no reason why Pred has that instantiatedness, unless it is some limitation of the combined higher-order types and insts implementation or an actual bug.

Additional InformationThe users original program can be found here: <>
TagsNo tags attached.
Attached Files? bug574.m (461) 2024-05-06 00:35

2024-05-06 00:46   
This is not so much a bug as a not-yet-fully-implemented feature.
The code for *accepting* insts in types was done years ago, but
the code for *using* insts in types was not. In the absence of that
code, having the inst "get lost" is unfortunately the accepted behavior.

I have already started work on this issue some months ago, but got
distracted by other things. I guess I can resume work on it after
I get done with the first pass through the parts of the compiler
that generate diagnostics to add color.

Issue History
2024-05-06 00:35juliensfNew Issue
2024-05-06 00:35juliensfFile Added: bug574.m
2024-05-06 00:46zsNote Added: 0001232