mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
library/enum.m:
As above.
NEWS.md:
Announce this breaking change.
library/bool.m:
library/char.m:
library/int.m:
library/term.m:
library/uint.m:
tests/hard_coded/deep_copy_exist.m:
tests/typeclasses/extract_typeinfo2.m:
Conform to the change in enum.m.
compiler/pred_table.m:
When typechecking leaves am ambiguity unresolved, a predicate
in this module used to pick one of the candidate matches effectively
at random to "resolve" it.
After the change to enum.m, this led to a compiler abort when compiling
uint.m. The ambiguity was between uint.from_int/2 and the new
enum.from_int/2. The old algorithm picked enum.from_int/2, and tried
to look up its class constraints in the current class context; this failed
with an abort, because the current class context was empty.
Fix this by choosing the match (or *a* match) with the fewest typeclass
constraints to "resolve" any ambiguities.
tests/invalid/overload_resolution_preference.{m,err_exp}:
A test case for the change to pred_table.m.
tests/invalid/Mmakefile:
Enable the new test case.
tests/invalid_submodules/unresolved_overloading.err_exp:
Update this expected output after the change to pred_table.m.
951 B
951 B
unresolved_overloading.m:026: Error: unresolved overloading for predicate
unresolved_overloading.m:026: `annoying'. The matches are
unresolved_overloading.m:026: `unresolved_overloading.annoying'/3,
unresolved_overloading.m:026: `unresolved_overloading.sub.annoying'/3.
unresolved_overloading.m:026: You need to use an explicit module qualifier to
unresolved_overloading.m:026: select the one you intend to refer to.
unresolved_overloading.m:026: Proceeding on the assumption that the intended
unresolved_overloading.m:026: match is `unresolved_overloading.annoying'/3.
unresolved_overloading.m:026: If this assumption is incorrect, other error
unresolved_overloading.m:026: messages may be reported for this predicate or
unresolved_overloading.m:026: function solely because of this wrong
unresolved_overloading.m:026: assumption.
unresolved_overloading.m:026: `annoying'. The matches are
unresolved_overloading.m:026: `unresolved_overloading.annoying'/3,
unresolved_overloading.m:026: `unresolved_overloading.sub.annoying'/3.
unresolved_overloading.m:026: You need to use an explicit module qualifier to
unresolved_overloading.m:026: select the one you intend to refer to.
unresolved_overloading.m:026: Proceeding on the assumption that the intended
unresolved_overloading.m:026: match is `unresolved_overloading.annoying'/3.
unresolved_overloading.m:026: If this assumption is incorrect, other error
unresolved_overloading.m:026: messages may be reported for this predicate or
unresolved_overloading.m:026: function solely because of this wrong
unresolved_overloading.m:026: assumption.