[mercury-users] Existential type constraints
Mark Brown
mark at cs.mu.OZ.AU
Fri Jul 29 12:50:51 AEST 2005
On 29-Jul-2005, Peter Hawkins <peter at hawkins.emu.id.au> wrote:
> Mark Brown wrote:
>
> >On 29-Jul-2005, Peter Hawkins <peter at hawkins.emu.id.au> wrote:
> >
> >
> >>(I just spent an enjoyable 15 minutes tracking down a missing 'some [T]'
> >>on a predicate declaration, and I wasn't helped by a misleading error
> >>message).
> >>
> >>
> >
> >What version of the compiler are you using, and what was the misleading
> >error message?
> >
> >
> $ mmc --version
> Mercury Compiler, version rotd-2005-07-07, configured for i686-pc-linux-gnu
> Copyright (C) 1993-2005 The University of Melbourne
>
> (self-built)
>
> The error message was like this:
> csp_bounds.m:013: In predicate `csp_bounds.propagate/2':
> csp_bounds.m:013: warning: unresolved polymorphism.
> csp_bounds.m:013: The variables with unbound types were:
> csp_bounds.m:013: Var2: ((bdd_solver.cvar).cvar(V_V_1))
> csp_bounds.m:013: Var1: ((bdd_solver.cvar).cvar(V_V_1))
> csp_bounds.m:013: V1: ((bdd_solver.cvar).cvar(V_V_1))
> csp_bounds.m:013: The unbound type variable(s) will be implicitly
> csp_bounds.m:013: bound to the builtin type `void'.
> The body of the clause contains a call to a polymorphic predicate,
> but I can't determine which version should be called,
> because the type variables listed above didn't get bound.
> (I ought to tell you which call caused the problem, but I'm afraid
> you'll have to work it out yourself. My apologies.)
(This is a warning, not an error, btw.)
The problem is that nothing in your code is binding the type variable in
question. One way that type variables can get bound is via a call to an
existentially quantified predicate or function, so if the existential
quantifier is missing, as it was in your code, then that would explain why
the type variable was unbound. There are plenty of other ways for a type
variable to become bound, though, and the compiler has no way of knowing
what the intent of the programmer was. Hence it can't give you a more
specific error.
Cheers,
Mark.
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list