[m-rev.] for review: fix testing of `ground' matches `bound'

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jul 8 16:46:30 AEST 2003


On 08-Jul-2003, David Overton <dmo at cs.mu.OZ.AU> wrote:
> compiler/modules.m:
> 	When writing discriminated union types to the .int2 file, write
> 	out the full type definition rather than an abstract type
> 	declaration.

Won't that cause problems for types with user-defined equality or
comparison procedures?  The .int2 file would then contain a reference
to a procedure which had not been declared.

> +++ compiler/type_util.m	8 Jul 2003 01:43:51 -0000
> @@ -1851,14 +1851,8 @@
>  
>  maybe_get_cons_id_arg_types(ModuleInfo, MaybeType, ConsId0, Arity, MaybeTypes)
>  		:-
> -	( ConsId0 = cons(SymName, _) ->
> -		( SymName = qualified(_, Name) ->
> -			% get_cons_id_non_existential_arg_types
> -			% expects an unqualified cons_id.
> -			ConsId = cons(unqualified(Name), Arity)
> -		;
> -			ConsId = ConsId0
> -		),
> +	( ConsId0 = cons(_SymName, _) ->
> +		ConsId = ConsId0,

This change violates the documentation for
get_cons_id_non_existential_arg_types, which says that
that procedure expects an unqualified cons_id.
If that documentation is wrong, it should be changed.

> Index: tests/invalid/undef_symbol.err_exp
...
> -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'.

I agree with Simon's review comment.
Failing to report that error would be a bug.

-- 
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