[m-dev.] for review: fix bug in record syntax

Simon Taylor stayl at cs.mu.OZ.AU
Thu May 4 11:29:50 AEST 2000


> On 03-May-2000, Simon TAYLOR <stayl at cs.mu.OZ.AU> wrote:
> > 
> > Fix a bug in record syntax reported by Tom Conway which caused a
> > compiler abort if there was a field and a constructor with the
> > same name.

Fergus wrote:
> Does this fix work for the following test case?
> 
> 	:- module test2.
> 	:- interface.
> 
> 	:- type foo ---> some [T] debug(T).
> 	:- type bar ---> bar( debug :: int ).
> 
> 	:- pred baz(int, bar).
> 	:- mode baz(in, in) is semidet.
> 
> 	:- implementation.
> 
> 	baz(debug(X), X).
> 


It does. I've added it to tests/valid/record_syntax_bug.m.

Simon.

--- record_syntax_bug.m	2000/05/04 01:22:37	1.1
+++ record_syntax_bug.m	2000/05/04 01:25:16
@@ -5,11 +5,16 @@
 :- interface.
 
 :- type foo ---> debug(string).
+:- type foo2 ---> some [T] debug(T).
 :- type bar ---> bar( debug :: int ).
 
 :- func dest(foo) = int.
 
+:- pred baz(int, bar).
+:- mode baz(in, in) is semidet.
+
 :- implementation.
 
 dest(debug(_)) = 42.
 
+baz(debug(X), X).
--------------------------------------------------------------------------
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