tests/invalid/*.m:
Rename modules as mentioned above.
In two cases where the main module name is a Mercury keyword (to the
extent that Mercury has keywords), add a "test_" prefix to the
module name.
Reorganize the ho_default_func_2 test case. The original code
of this test had three modules, a parent and two children,
with the module being tested being one of the *child* modules
(ho_default_func_2.sub). This does not work; the .log file
from the successful execution of this test case showed that
there was no actual compilation involved; the test stopped
after invoking "mmc --generate-dependencies" on that child module.
The new version of this test makes that child module the main module,
and moves the relevant parts of the other two original modules
into a single new child module.
Rename ii_parent to instance_pc (pc being short for parent-child).
This test case still has the child module listed as the target
in Mmakefile, so it still does not progress past generating its
dependencies.
Rename the imported_mode test case as bad_exported_mode,
because this is what it was testing.
exported_mode.m was used both as the main module of a test,
and as a helper module in the imported_mode test (now renamed
to bad_exported_mode). Make a copy of it as a helper module
for bad_exported_mode.
Update all references to the moved modules.
General updates to programming style, such as
- replacing DCG notation with state var notation
- adding lines around vim modelines
- fixing indentation
- fixing grammar errors in comments
tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
Update all references to the moved modules and/or moved lines.
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: 1
Branches: main
Fix a bug (#27) reported by Ralph. The compiler was aborting on
instances that contained type variables that were not wrapped in functors.
The problem is that the name mangling scheme used to mangle the names of
method wrapper predicates cannot handle instances that contain unwrapped
type variables. The compiler already has code to check for this, but that
check was not being performed until *after* it had attempted to introduce
the method wrapper predicates.
The fix is to reorder the phases of check_typeclass.m so that we perform
the check on the types in an instance first and only run the remaining
phases if the first one succeeds.
compiler/check_typeclass.m:
Reorder the phases within this module so that we don't attempt
to introduce method wrapper predicates for invalid instances.
Update the documentation in this module to conform to the above
change.
Remove some unnecessary module qualification.
tests/invalid/Mercury.options:
tests/invalid/Mmakefile:
tests/invalid/instance_var_bug.{m,err_exp}:
Test for the above bug.
tests/invalid/bad_instance.err_exp:
Update this. The error message for the missing concrete instance
won't be emitted with the above change. Note, we have a separate
test case, tests/invalid/missing_concrete_instance, that exercises
that error message.