[m-rev.] diff: add another test of duplicate instance decls

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Jun 27 18:34:01 AEST 2001


Estimated hours taken: 0.5
Branches: main

tests/invalid/Mmakefile:
tests/invalid/duplicate_instance_3.m:
	Add a test case to test that we report link errors for duplicate
	instance definitions.  This case is not yet enabled, since we
	don't yet pass it in all situations.

Workspace: /home/hg/fjh/mercury
Index: tests/invalid/duplicate_instance_3.m
===================================================================
RCS file: duplicate_instance_3.m
diff -N duplicate_instance_3.m
--- /dev/null	Thu Mar 30 14:06:13 2000
+++ duplicate_instance_3.m	Thu May 17 02:03:23 2001
@@ -0,0 +1,16 @@
+:- module duplicate_instance_3.
+:- interface.
+:- import_module io.
+
+:- pred main(state::di, state::uo) is det.
+
+:- implementation.
+:- import_module enum.
+
+% This instance definition conflicts with the one in library/int.m.
+:- instance enum(int) where [
+        to_int(_) = 0,
+	from_int(X) = X
+].
+
+main --> [].
Index: tests/invalid/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/invalid/Mmakefile,v
retrieving revision 1.86
diff -u -d -r1.86 Mmakefile
--- tests/invalid/Mmakefile	2001/05/16 17:28:43	1.86
+++ tests/invalid/Mmakefile	2001/06/27 08:32:23
@@ -120,6 +120,10 @@
 SOURCES= $(SINGLEMODULE_SOURCES) $(MULTIMODULE_SOURCES)
 
 # we do not yet pass the following tests:
+#	duplicate_instance_3 (the error is only detected when doing
+#		normal static linking; the error goes undetected
+#		when doing dynamic linking, or when the library
+#		was built with `--split-c-files')
 #	parent.undeclared_child.m (just not yet implemented)
 #	sub_b.m and sub_c.m (bug with dependencies & nested modules)
 #	freefree.m 	(need bromage's aliasing stuff)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list