[clean-list] True Uniqueness Typing Error or Compiler Bug ?
Fabien Todescato
f.todescato@larisys.fr
Wed, 22 Jan 2003 16:20:22 +0100
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 = '*'.
This arises when trying to compile the following code snippet :
module uTypeBug
import StdEnv
class
nextSymbol context thread symbol
:: ( symbol context .thread -> .thread )
( .thread -> .thread )
context .thread -> .thread
instance
nextSymbol Int File Char
where
nextSymbol yes no index file
# (ok,file) = fseek file index FSeekSet
| not ok = no file
# (ok,char,file) = freadc file
| not ok = no file
# index = index + 1
= yes char index file
Start = "uTypeBug"
Any clue ?
Best regards, Fabien Todescato
PS.Happy new year to you all, and kudos to the Clean Team for bringing to us
a lot of improvement to an already great system.