[clean-list] True Uniqueness Typing Error or Compiler Bug ?

Erik Zuurbier EZuurbier@Abz.nl
Thu, 23 Jan 2003 10:35:37 +0100


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C2C2C2.C91A8E80
Content-Type: text/plain

Fabien wrote:
>Dear Cleaners, I get the following uniqueness typing error from the 2.0.2
compiler :
>Type error [uTypeBug.icl,14,nextSymbol] : specified type
>( Char -> Int -> u:File -> u:File) (u:File->u:File) Int u:File -> u:File
conflicts with derived type
>( Char -> Int -> * File -> * File) (* File->* File) Int * File -> * File
>which I find quite confusing since the former type can be unified with the
latter with the substitution u = '*'. 


My understanding of uniqueness attributes such as u: is that each variable
can take on two different values, unique or non-unique. That would mean that
your specified type asserts that the function has two different type
instantiations:

( Char -> Int -> * File -> * File) (* File->* File) Int * File -> * File

this is is the one derived by the compiler, and:

( Char -> Int ->   File ->   File) (  File->  File) Int   File ->   File

The type checker apparently cannot agree with this latter one. And indeed
the function's implementation contains fseek and freadc - operations that
work only on unique files.

Regards Erik Zuurbier 


------_=_NextPart_001_01C2C2C2.C91A8E80
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">



True Uniqueness Typing Error or Compiler Bug ?



Fabien wrote:
>Dear Cleaners, I get the = following uniqueness typing error from the 2.0.2 compiler :
>Type error = [uTypeBug.icl,14,nextSymbol] : specified type
>( Char -> Int -> u:File = -> u:File) (u:File->u:File) Int u:File -> u:File conflicts = with derived type
>( Char -> Int -> * File = -> * File) (* File->* File) Int * File -> * File
>which I find quite confusing = since the former type can be unified with the latter with the = substitution u =3D '*'.


My understanding of uniqueness = attributes such as u: is that each variable can take on two different = values, unique or non-unique. That would mean that your specified type = asserts that the function has two different type = instantiations:

( Char -> Int -> * File -> * = File) (* File->* File) Int * File -> * File

this is is the one derived by the = compiler, and:

( Char -> Int ->   = File ->   File) (  File->  File) = Int   File ->   File

The type checker apparently cannot = agree with this latter one. And indeed the function's implementation = contains fseek and freadc - operations that work only on unique = files.

Regards Erik Zuurbier=20

------_=_NextPart_001_01C2C2C2.C91A8E80--