[m-dev.] diff: bug fix for Tom's error reporting change

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Tue Oct 6 10:41:26 AEST 1998


Fergus Henderson, you write:
> compiler/typecheck.m:
> 	Fix a bug in conway's recent change to error reporting for
> 	undefined explicitly qualified names: the current module is
> 	always in scope, so don't say that it is not imported.

The change looks fine. Here's a diff so that the undef_symbol test case
checks this too.

-- 
Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+

Add a test case for the changes to the undefined symbol error message.

tests/invalid/undef_symbol.{m,err_exp}:
	Add a test to make sure we get the error message right if the
	undefined symbol is qualified with the current module name.

cvs diff: Diffing .
Index: undef_symbol.err_exp
===================================================================
RCS file: /home/staff/zs/imp/tests/invalid/undef_symbol.err_exp,v
retrieving revision 1.1
diff -u -r1.1 undef_symbol.err_exp
--- undef_symbol.err_exp	1998/09/22 23:12:33	1.1
+++ undef_symbol.err_exp	1998/10/06 00:39:32
@@ -1,7 +1,9 @@
-undef_symbol.m:018: In clause for predicate `undef_symbol:p/2':
-undef_symbol.m:018:   error: undefined predicate `string:append/3'
-undef_symbol.m:018:   (the module `string' has not been imported).
-undef_symbol.m:024: In clause for predicate `undef_symbol:q/2':
-undef_symbol.m:024:   error: undefined symbol `term:context/2'
-undef_symbol.m:024:   (the module `term' has not been imported).
+undef_symbol.m:014: In clause for predicate `undef_symbol:main/2':
+undef_symbol.m:014:   error: undefined predicate `undef_symbol:r/2'.
+undef_symbol.m:019: In clause for predicate `undef_symbol:p/2':
+undef_symbol.m:019:   error: undefined predicate `string:append/3'
+undef_symbol.m:019:   (the module `string' has not been imported).
+undef_symbol.m:025: In clause for predicate `undef_symbol:q/2':
+undef_symbol.m:025:   error: undefined symbol `term:context/2'
+undef_symbol.m:025:   (the module `term' has not been imported).
 For more information, try recompiling with `-E'.
Index: undef_symbol.m
===================================================================
RCS file: /home/staff/zs/imp/tests/invalid/undef_symbol.m,v
retrieving revision 1.1
diff -u -r1.1 undef_symbol.m
--- undef_symbol.m	1998/09/22 23:12:35	1.1
+++ undef_symbol.m	1998/10/06 00:31:53
@@ -10,7 +10,8 @@
 
 main -->
 	p,
-	q.
+	q,
+	undef_symbol__r.
 
 :- pred p(io__state::di, io__state::uo) is det.
 
@@ -23,4 +24,6 @@
 q -->
 	{ Context = term__context("random", 17) },
 	write(Context), nl.
+
+% :- pred r(io__state::di, io__state::uo) is det.
 



More information about the developers mailing list