[m-dev.] diff: prevent double export

David Glen JEFFERY dgj at cs.mu.OZ.AU
Thu Aug 19 15:23:04 AEST 1999


On 18-Aug-1999, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> The only thing about this diff that needs looking at is that someone who knows
> the type checker should put in a check that detects double declarations.

The type checker isn't really the right place to do this; it should be checked
as it is added to the HLDS. However, it looks like it is a deliberate decision
to allow multiple declarations:

<from make_hlds.m:>
=============================================================================

	% We allow more than one "definition" for a given type so
	% long all of them except one are actually just declarations,
	% e.g. `:- type t.', which is parsed as an type definition for
	% t which defines t as an abstract_type.

:- pred module_add_type_defn(module_info, tvarset, type_defn, condition,
		prog_context, item_status, module_info, io__state, io__state).
:- mode module_add_type_defn(in, in, in, in, in, in, out, di, uo) is det.

=============================================================================

It would be simple enough to add a check here, but apparently this is
deliberately not done. Fergus?


dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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