tests/invalid/*.{m,err_exp}:
tests/misc_tests/*.m:
tests/mmc_make/*.m:
tests/par_conj/*.m:
tests/purity/*.m:
tests/stm/*.m:
tests/string_format/*.m:
tests/structure_reuse/*.m:
tests/submodules/*.m:
tests/tabling/*.m:
tests/term/*.m:
tests/trailing/*.m:
tests/typeclasses/*.m:
tests/valid/*.m:
tests/warnings/*.{m,exp}:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the tests
that check compiler error messages, expect the new line numbers.
browser/cterm.m:
browser/tree234_cc.m:
Import only one module per line.
tests/hard_coded/boyer.m:
Fix something I missed.
Estimated hours taken: 16
Branches: main
Support polymorphic instances of typeclasses with functional dependencies.
We do this by allowing type variables in the range arguments, which must be
distinct according to existing typeclass restrictions, to be determined
from type variables in the domain arguments by the functional dependencies
on the instance constraints.
compiler/check_typeclass.m:
Remove the range-restrictedness check and replace it with a coverage
check, which makes use of the instance constraints when determining
if a type variable is bound.
Explicitly pass the range tvars to get_unbound_tvars, so that it
can be used by the coverage pass as well as the
check_typeclass_constraints pass.
Rearrange the structure of the module, since multiple passes now
make use of the get_unbound_tvars predicate. Separate out the
error reporting code from the main logic.
Clarify the description at the top of this module. It now corresponds
more closely with the structure of the module.
Fix a bug in check_instance_pred_procs/12 whereby the wrong context
was being used in the new instance definition, leading to incorrect
error messages; use field update syntax to avoid this problem.
doc/reference_manual.texi:
Add an example to illustrate the relaxed restrictions.
tests/valid/Mmakefile:
tests/valid/fundeps_poly_instance.m:
Test the new feature.
tests/invalid/Mmakefile:
tests/invalid/fundeps_coverage.err_exp:
tests/invalid/fundeps_coverage.m:
Test the new error reporting.
tests/invalid/range_restrict.err_exp:
Update for the changed error message.
tests/invalid/typeclass_bogus_method.err_exp:
tests/invalid/typeclass_test_10.err_exp:
Update these expected outputs for the bugfix.