On 17/10/2025 23:23, vqn wrote:
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.
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.
I suspect the problem is that some of the original modules that contained the types have not been included as dependencies in subsequent modules. As a result the types will have been duplicated and won't match.
When you export a module are you listing only the immediate children as dependencies in saveDependentModule or are you including the full dependency tree? To be safe, the whole tree needs to be included.
David