[m-dev.] Polymorphic insts problem

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jan 27 02:30:55 AEDT 2005


On 25-Jan-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Attached are two modules, globalvar.m and test_globalvar.m.  When I try
> compiling test_globalvar.m I get the following error:
> 
> test_globalvar.m:041: In clause for `g = out((test_globalvar.ch))':
> test_globalvar.m:041:   mode error: argument 1 had the wrong instantiatedness.
> test_globalvar.m:041:   Final instantiatedness of `G' was `bound((test_globalvar.z))',
> test_globalvar.m:041:   expected final instantiatedness was `bound(s((test_globalvar.ch)) ; z)'.

This one seems to be a problem with module qualification.
A work-around is to use explicit module qualifiers in the inst
declaration:

--- /home/pgrad/fjh/Mail.in/test_globalvar.m	2005-01-27 02:29:57.000000000 +1100
+++ ./test_globalvar.m	2005-01-27 02:28:46.000000000 +1100
@@ -29,7 +29,7 @@
 
 
 :- type ch ---> z ; s(ch).
-:- inst ch ---> z ; s(ch).
+:- inst ch ---> test_globalvar.z ; test_globalvar.s(ch).
 
 
 
-- 
Fergus Henderson                    |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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