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: 2
Branches: main, release-0.12
Only allow existential constraints to constrain existentially quantified
type variables. Likewise only allow universal constraints to constrain
universally quantified type variables.
We previously didn't check these conditions, and in fact the reference
manual allowed otherwise. However, the implementation did not support
existential constraints on universally quantified type variables, and
will not do so for the foreseeable future. The implementation does support
universal constraints on existentially quantified variables, however these
are not useful since no caller will ever be able to satisfy the constraints.
compiler/check_typeclass.m:
Check these conditions as part of typeclass checking.
Also return a bool from the recently added check for concrete
instances, indicating whether errors were found or not.
compiler/error_util.m:
compiler/hlds_error_util.m:
Add a couple of utility functions for constructing error messages.
compiler/mercury_compile.m:
Stop compilation after checking typeclasses if errors were encountered.
If the above conditions are not met then typechecking may abort.
doc/reference_manual.texi:
Document the condition on typeclass constraints.
tests/invalid/Mmakefile:
tests/invalid/quant_constraint_1.err_exp:
tests/invalid/quant_constraint_1.m:
tests/invalid/quant_constraint_2.err_exp:
tests/invalid/quant_constraint_2.m:
Test cases for the new error messages.
tests/invalid/unbound_type_vars.err_exp:
Update this test case.