[MLton] New front-end finds bug in basis library
Stephen Weeks
MLton@mlton.org
Mon, 19 Jan 2004 19:48:53 -0800
Hi Jared. Thanks for the bug report.
> The reader and writer types in BinIO.StreamIO are not the same as in
> BinPrimIO. So, the following program should elaborate if the basis
> library is conformant, but it doesn't:
>
> type r = BinIO.StreamIO.reader
> val f : r -> r = fn x : BinPrimIO.reader => x
>
> yields:
>
> Error: test.sml 2.5: pattern and expression disagree
> pattern: [r] -> [r]
> expression: [BinPrimIO.reader] -> [BinPrimIO.reader]
> in: (f): (r -> r) = fn ((x): BinPrimIO.reader) => (x)
> compilation aborted: elaborate reported errors
>
>
> This appears to be a bug in the basis library the is caught by the new
> front-end,
Yes. We missed some sharing constraints. I've added them to
basis-library/libs/basis-2002/top-level/basis.sig
Since we now distribute the basis library sources with the MLton
packages, if you need the changes urgently you can patch your copy of
the basis library sources and immediately see the fix.
Let us know if you see anything else, and thanks for testing the
experimental release.