[m-dev.] Submodule visibility rules
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Jul 11 21:55:52 AEST 2002
On 02-Jul-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Simon Taylor, Tuesday, 2 July 2002:
> >
> > The intention is that if the sub-module is declared in the interface,
> > its interface should only depend on the interface items of the parent.
> > I'm not sure whether that is checked properly when creating the interface
> > files, but if a client attempts to use any names local to the parent the
> > compiler should report an error.
>
> The compiler does complain if a client tries to use such things, but
> doesn't prevent use of equivalence types defined in the submodule
> interface that are synonyms for private parent types,
It should, if the submodule is exported.
i.e. the following module is not legal:
:- module m.
:- interface.
:- module sub.
:- interface.
:- type foo == bar.
:- end_module sub.
:- implementation.
:- type bar ---> bar(int).
:- end_module m.
If the compiler doesn´t report an errors for this module,
then the compuiler should be changed so that it does so.
--
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-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