[MLton] funny error message

Vesa Karvonen vesa.karvonen@cs.helsinki.fi
Fri, 23 Sep 2005 15:11:40 +0300


Quoting "Wesley W. Terpstra" <wesley@terpstra.ca>:
> Btw, why does this compile?
> 
> fun id2 x y = y
> signature X = sig val y: 'a -> 'a end
> structure Y = struct val y = id2 "x" val z = y 5 end
             ^
    Missing constraint?

HaMLet 1.2 - To Be Or Not To Be Standard ML
[loading standard basis library]
- fun id2 x y = y ;
val id2 = <fn> : 'a -> 'b -> 'b
- signature X = sig val y: 'a -> 'a end ;
signature X = sig val y : 'a -> 'a end
- structure Y = struct val y = id2 "x" val z = y 5 end ;
structure Y =
  struct
    val y = <fn> : int -> int
    val z = 5 : int
  end
- structure Y : X = struct val y = id2 "x" val z = y 5 end ;
1.10-1.57: structure does not match constraint

-Vesa Karvonen