[m-dev.] diff: fix module_qual.m error message

Simon Taylor stayl at cs.mu.OZ.AU
Mon Oct 4 14:03:35 AEST 1999


Estimated hours taken: 0.25

compiler/module_qual.m:
	Don't report that builtin.m or private_builtin.m have not
	been imported in error messages for undefined symbols.

tests/invalid/Mmakefile:
tests/invalid/builtin_int.m:
tests/invalid/builtin_int.err_exp:
	Test case.


Index: compiler/module_qual.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/module_qual.m,v
retrieving revision 1.50
diff -u -u -r1.50 module_qual.m
--- module_qual.m	1999/09/10 09:42:53	1.50
+++ module_qual.m	1999/10/04 03:43:33
@@ -1240,7 +1240,10 @@
 	term__context_init(Context),
 	ErrorContext = type(unqualified("") - 0) - Context,
 	set__init(InterfaceModules0),
-	set__init(ImportedModules),
+	mercury_public_builtin_module(BuiltinModule),
+	mercury_private_builtin_module(PrivateBuiltinModule),
+	set__list_to_set([BuiltinModule, PrivateBuiltinModule],
+		ImportedModules),
 	id_set_init(Empty),
 	Info0 = mq_info(ImportedModules, Empty, Empty, Empty, Empty,
 			Empty, InterfaceModules0, not_exported, 0, no, no,
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/staff/zs/imp/tests/invalid/Mmakefile,v
retrieving revision 1.48
diff -u -u -r1.48 Mmakefile
--- Mmakefile	1999/09/21 07:10:19	1.48
+++ Mmakefile	1999/10/04 03:51:34
@@ -12,6 +12,7 @@
 	any_mode.m \
 	bigtest.m \
 	bind_var_errors.m \
+	builtin_int.m \
 	circ_type.m \
 	constructor_warning.m \
 	det_errors.m \

tests/invalid/builtin_int.m
===================================================================
% Check that compiler/module_qual.m does not add a spurious
% "(the module `builtin' has not been imported)" to the
% end of the undefined type error message.
:- module builtin_int.

:- interface.

:- pred foo(builtin__ints::in) is semidet.

:- implementation.

foo(1).

tests/invalid/builtin_int.err_exp
===================================================================
builtin_int.m:008: In definition of predicate `builtin_int:foo'/1:
builtin_int.m:008:   error: undefined type `builtin:ints'/0.
For more information, try recompiling with `-E'.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list