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.
Branches: main
Fix a problem in the mutable inst validity check.
compiler/hlds_code_util.m:
Make the mutable inst validity check handle recursive user defined insts
correctly.
tests/nvalid/uniq_mutable.{m,err_exp}:
Add a test case for the above.
Estimated hours taken: 2
Branches: main
Restrict the insts that are allowed to appear in mutable declarations.
In particular mutables are now no longer allowed to have the insts
(mostly-)unique or free.
doc/reference_manual.texi:
The inst in a mutable should not be, nor should it contain components
that are, unique, mostly_unique, free, dead or mostly_dead. For
most of these it doesn't actually make a lot of sense and for some
of them, e.g. mostly_unique mutables, the code we currently generate
for mutables ends up being mode incorrect.
XXX If we supported partial instantiation then it might make sense
for mutables to have insts that contain free components but we'll
cross that bridge when we come to it.
Reword the restriction on typeclass constraints on mutables; as
written it looks like the typeclass constraints are being applied to
the inst variables.
compiler/hlds_code_util.m:
s/hlds/HLDS in a comment.
Add a predicate that tests if an inst is valid inst for a mutable
declaration.
compiler/make_hlds_passes.m:
Check that the inst in a mutable declaration conforms to the above
rules and emit an error message if it does not.
Turn an if-then-else into a switch.
Fix an overlong line.
compiler/prog_mode.m:
Fix some formatting.
tests/invalid/Mmakefile:
tests/invalid/uniq_mutable.{m,err_exp}:
Test case for the above.
tests/invalid/bad_mutable.err_exp:
Conform to the above change.
XXX We shouldn't really complain about as in this case the real
error is the fact that the inst is undefined.