Commit Graph

5 Commits

Author SHA1 Message Date
Fergus Henderson
239e96ec59 Clean up the handling of unbound type variables.
Estimated hours taken: 8

Clean up the handling of unbound type variables.
Fix a bug with unbound type variables in lambda expressions.
Run purity analysis, modechecking etc. even if there were type errors.

compiler/mercury_compile.m:
	Run purity analysis, modechecking etc. even if there were type
	errors.  This fixes a bug (inconsistency between the code and
	the comments) that seems to have been introduced in stayl's
	change to mercury_compile.m (revision 1.25) to add intermodule
	unused argument elimination: the comment said "continue,
	even if type checking found errors", but the code did not
	continue.

	This change was needed to ensure that we still report a warning
	message about unused type variables for tests/invalid/error2.m;
	without it, we stop after type checking and don't do purity
	analysis, and so don't report the warning.

compiler/typecheck.m:
compiler/purity.m:
	Move the code for checking for unbound type variables
	from typecheck.m to purity.m.  It needs to be done
	*after* type inference has been completed, so it
	can't be done in the ordinary type checking/inference
	passes.  Add code to purity.m to bind the
	unbound type variables to the builtin type `void'.

compiler/polymorphism.m:
	Comment out old code to bind unbound type variables
	to `void'; the old code was incomplete, and this
	is now done in purity.m.

compiler/notes/compiler_design.html:
	Document the above changes.

tests/valid/Mmakefile:
tests/valid/unbound_tvar_in_lambda.m:
	Regression test for the above-mentioned bug with unbound type
	variables in lambda expressions.

tests/warnings/singleton_test.exp:
tests/invalid/errors2.err_exp:
	Change the expected warning message for unbound type variables.
	The error context is not as precise as it used to be, I'm afraid:
	we only know which function/predicate the error occurred in,
	not which clause.  Also it now comes out in a different order
	relative to the other error messages.

tests/invalid/errors2.err_exp:
tests/invalid/funcs_as_preds.err_exp:
	Add some new error/warning messages that are output now that
	we run mode and determinism analysis even if there are type errors.
1998-01-02 00:11:41 +00:00
Simon Taylor
9a23c8e1ac Test cases for `:- use_module'
Estimated hours taken: 0.1

tests/invalid/errors.m
tests/invalid/errors2.m
	Test cases for `:- use_module'
1997-06-29 23:24:38 +00:00
Fergus Henderson
16916489a9 <overview or general description of changes>
Estimated hours taken: _____

<overview or general description of changes>

<directory>/<file>:
	<detailed description of changes>
1997-05-04 17:43:02 +00:00
Zoltan Somogyi
c30efafc56 It seems that when I added the runtests files for all the subdirectories
Estimated hours taken: 3

It seems that when I added the runtests files for all the subdirectories
in tests, I did not do a "cvs add" for invalid/runtests (even though the
log message says I did). As a consequence, our test runs since then
have not exercised the test cases in this directory. This checkin
fixes that oversight.

runtests:
	Shell script to exercise the test cases in this directory.

qual_basic_test2.*:
	A test case that was removed from hard_coded a while ago because
	it was really a test of the error message.

*.err_exp:
	Updated the expected error message outputs for several test cases
	according to the changes of the last few months. Added two missing
	.err_exp files.

Mmake:
	Disabled the tests prog_io_erroneous and qualified_cons_id2
	since we do not pass them, and I don't know what the expected output
	ought to be (it should not be what we output now).
1997-04-27 05:28:58 +00:00
Zoltan Somogyi
64b3e74266 A script to compare actual and expected error outputs from the
Estimated hours taken: 0.5

runtests:
	A script to compare actual and expected error outputs from the
	compiler.

Mmake:
	Don't test types.m, since we don't pass it, and lambda_type_bad,
	since the tested code is no longer invalid.

*.err_exp:
	The expected error outputs.
1996-11-04 07:15:18 +00:00