[m-users.] How to avoid warning about highly ambiguous overloading
Dirk Ziegemeyer
dirk at ziegemeyer.de
Tue Jul 19 22:14:57 AEST 2016
Hi Mark,
>> I create several emtpy maps with the function map.init/0 and mercury warns me about highly ambiguous overloading.
>
> Note that this can occur as a consequence of other errors, so it can
> help to fix any other errors first before tackling the ambiguous
> overloading.
>
>> Can I use explicit type qualification to tell Mercury that I mean the function map.init/0 instead of the predicate map.init/1?
>
> Yes. If you want map.init to mean the function which returns, say,
> map(a, b), then write
>
> map.init : map(a, b)
Thank you for helping me with the syntax of explicit type qualification. This works perfectly.
Dirk
More information about the users
mailing list