Re: More confusion with mutually recursive type definitions

From: Jacques GARRIGUE (garrigue@kurims.kyoto-u.ac.jp)
Date: Mon Aug 16 1999 - 09:57:49 MET DST


To: Francois.Pottier@inria.fr
Subject: Re: More confusion with mutually recursive type definitions
In-Reply-To: Your message of "Mon, 16 Aug 1999 09:51:18 +0200"
        <19990816095118.02091@pauillac.inria.fr>
Message-Id: <19990816165749X.garrigue@kurims.kyoto-u.ac.jp>
Date: Mon, 16 Aug 1999 16:57:49 +0900
From: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>

> OK, so I understand the following error message:
>
> # type 'a t = 'a and u = int t and v = bool t;;
> This type bool should be an instance of type int
>
> But then, why is the following declaration accepted?
>
> # type 'a t = 'a and u = A of int t and v = B of bool t;;
> type 'a t = 'a
> type u = | A of int t
> type v = | B of bool t
>
> I am still confused...

And ought to be... this is a bug:

        Objective Caml version 2.02

# type 'a t = 'a constraint 'a = int and u = A of int t and v = B of bool t;;
Uncaught exception: Ctype.Unify(_)

Is it already corrected ?

        Jacques
---------------------------------------------------------------------------
Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
                <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:24 MET