[mercury-users] ambiguous overloading

Ralph Becket rafe at cs.mu.OZ.AU
Tue Feb 25 17:17:39 AEDT 2003


Michael Day, Tuesday, 25 February 2003:
> 
> Hi,
> 
> When using map and multi_map I have to explicitly qualify "search" 
> otherwise the compiler gets confused:
> 
> 	error: ambiguous overloading causes type ambiguity.
> 	One or more of the predicates or functions called
> 	is declared in more than one module.
> 	Try adding explicit module qualifiers.
> 
> I thought it could infer which one to call from the type, given that I'm
> either passing in a map or a multi_map?

The first few lines of the multi_map module are

:- module multi_map.
:- interface.
:- import_module map, list, assoc_list, set.

:- type multi_map(Key, Data)    ==      map(Key, list(Data)).

Since multi_map is not an abstract type, you're going to get ambiguity
errors here.

- Ralph
--------------------------------------------------------------------------
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