Thanks for the fixes. I can confirm that those errors are indeed gone. I am however now facing an issue with opaque types mismatch when building smlfmt. I have once again been unable to find a smaller reproducer, but it happens both when exporting the first time, as well as when loading from disk in later runs.
Here's the error:
src/smlfmt.sml:227.0-233.0: error: Type error in function application. Function: TabbedTokenDoc.prettyJustComments {ribbonFrac = ribbonFrac, maxWidth = maxWidth, indentWidth = indentWidth, tabWidth = ..., ...} : ?.TabbedTokenDoc.Token.t t -> TabbedTokenDoc.CustomString.t Argument: cs : Token.t t Reason: Can't unify ?.TabbedTokenDoc.Token.t = token (*Created from opaque signature*) with Token.t = token (*Created from opaque signature*) (Different type constructors)
If that is of any help:
TabbedTokenDoc is declared in src/prettier-print/TabbedTokenDoc.sml from the TabbedTokenDoc functor (src/base/PrettyTabbedDoc.sml). The Token substructure is passed in as argument to the functor and contains the opened original Token structure (src/ast/Token.sml) as well as a few extra functions.
The original Token structure and the TabbedTokenDoc functor are exported in a first module, the TabbedTokenDoc structure is exported in another, and those two are imported into the final namespace which is used to compile src/smlfmt.sml.