[m-rev.] for review: module_add_type_defn

Julien Fischer jfischer at opturion.com
Wed Jun 28 15:05:15 AEST 2017


On Wed, 28 Jun 2017, Julien Fischer wrote:

>> And should it be an error to declare (not define) a type in both
>> the interface and the implementation section of a module?
>
> It's an error for predicate declarations, so I suppose for consistency
> it ought to be for types as well.  (Note that typeclass and instance
> declarations in both the interface and implementation are also both
> also currently allowed.)

Given that the latest version of the compiler on my machine also
accepts stuff like:

     :- module foo.
     :- interface.

     :- type foo(K, V).

     :- implementation.

     :- type foo(V, K).

     :- type foo(K, V) ---> foo(V, K).

I think it should defintely be an error.

Julien.


More information about the reviews mailing list