Strange Compiler Message

Ron Wichers Schreur ronny@cs.kun.nl
Wed, 27 Mar 1996 10:06:49 +0100


Gert Veltink wrote:

> I have the following somewhat peculiar error situation.
[..]
> ::ATYPE =       A
>         |       F ATYPE
> 
> 
> F :: ATYPE -> ATYPE
> F x     = A
 
> I got the following error messages from the compiler:
[..]
> Type error [Test.icl,18,Start]: "Start" cannot unify demanded type
>                                                      ATYPE with Int

> I'm wondering: "where did the 'Int' come from?"

Philip Matthews <philip@Newbridge.com> responded:

> if you change the name of the constructor "F" in "ATYPE" so that it
> doesn't conflict with the function named "F" then the program compiles
> without errors (at least on my machine).

This is indeed the problem. The Clean 1.0 allows you to define rewrite
rules for constructors, but the compiler doesn't handle this situation
very well. To simplify the compiler, we decided to remove this feature
from Clean 1.1.


Cheers,

Ronny Wichers Schreur
ronny@cs.kun.nl