[MLton] Bug in signature ascription

Wesley W. Terpstra terpstra at gkec.tu-darmstadt.de
Tue Feb 6 13:01:12 PST 2007


Attached are fold.sig and fold.sml. I am using a svn mlton from Jan 7th.

When compiling, you'll get the following error:
> Error: fold.sml 16.19.
>   Variable type in structure disagrees with signature.
>     variable: step0
>     structure: _ -> ((_ * [??? -> ???]) -> (((_ * [??? -> ???]) ->  
> _) -> _))
>     signature: _ -> ((_ * ['a]) -> (((_ * ['a]) -> _) -> _))
> Error: fold.sml 16.19.
>   Variable type in structure disagrees with signature.
>     variable: step1
>     structure: _
>                -> ((_ * [??? -> ???]) -> (_ -> (((_ * [??? -> ???])  
> -> _) -> _)))
>     signature: _ -> ((_ * ['a]) -> (_ -> (((_ * ['a]) -> _) -> _)))
> compilation aborted: parseAndElaborate reported errors

However, when the signature ascription from EITHER Fold or Foldr is  
removed, it compiles.
The error only appears when the signature is bound to both structures  
at the same time.
Even if the error is correct, I should have gotten it with just  
binding Foldr.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fold.sig
Type: application/octet-stream
Size: 449 bytes
Desc: not available
Url : http://mlton.org/pipermail/mlton/attachments/20070206/be9f9ab8/fold.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fold.sml
Type: application/octet-stream
Size: 1070 bytes
Desc: not available
Url : http://mlton.org/pipermail/mlton/attachments/20070206/be9f9ab8/fold-0001.obj


More information about the MLton mailing list