[m-rev.] for review: warn about exported insts for abstract types

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Aug 8 14:38:58 AEST 2008


On Fri, 8 Aug 2008, Peter Wang wrote:

> Branches: main
>
> Extend `--warn-insts-without-matching-type' to warn about insts defined in the
> interface which refer to constructors of types defined in the implementation.
> This is usually done because Mercury doesn't (yet) support abstract insts so
> the inst is exported while keeping the type abstract.  However, it is not
> really safe.  Other modules, can see the function symbols from the inst but
> cannot match them up to constructors from the type definition.  Hence those
> constructors never get module qualified.
>
> This is related to Mantis bug #26.
>
> compiler/inst_check.m:
> 	Check that exported inst definitions have a matching type that is
> 	visible (we can see its constructors) in the interface.
>
> 	Fix some spelling.
>
> compiler/mode_robdd.tfeirn.m:
> library/array2d.m:
> library/hash_table.m:
> library/tree234.m:
> 	Export previously abstract types in "secret" interface sections,
> 	where necessary to avoid the warning.
>
> tests/warnings/inst_with_no_type.exp:
> 	Update expected output.
>
> tests/warnings/inst_with_no_type.m:
> 	Fix a comment.

That's fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list