Open Skyb0rg007 opened 3 months ago
This is a duplicate of Issue #273 in the smlnj (Development) repository. I did some work on this. Here is a copy of the comment I submitted for #273:
I have done some preliminary work on this bug in the legacy version of the compiler. I thought that it might have a fairly trivial fix, but this turns out not to be the case. One complication is that it interacts with the hack I used to implement curried functors. The other problem is that it seems to be happening in the "entity function" that is produced during elaboration of functor declarations. In the Legacy version, the diagnostic messages that are implemented in the compiler/Elaborator/elabmod.sml file do not show what is going on with the entity function, and it is painful to fix or extend the diagnostic messages in the Legacy version. So I propose to get back to debugging this problem once I can do so in my newpp branch of the "development" version (smlnj/smlnj).
Since a new bug report for this problem has been submitted, I will raise the urgency of the bug and will do further work toward a fix. As the #273 comment indicates, the fix involves some fairly deep analysis and relates to the rather ad hoc approach to supporting curried functors and requires further debugging infrastructure related to entity functions in the module implementation. (Eventually this is going to all be reworked, so the fix will likely be specific to the current implementation with all its flaws and limitations.)
See further comments for Issue #273 under smlnj/smlnj.
Version
110.99.5 (Latest)
Operating System
OS Version
No response
Processor
System Component
Core system
Severity
Minor
Description
SML/NJ does not properly make types abstract when returned from functors.
Transcript
Expected Behavior
From the SML '97 definition:
Steps to Reproduce
Just type the code snippet
Additional Information
This code is correctly rejected by MLton with the error message:
This code is correctly rejected by PolyML with the error message:
This code is correctly rejected by Moscow ML with the error message:
This code is correctly rejected by MLKit with the error message:
This error was the source of a bug in one of our research projects, detected after type-checking with a different compiler.
Email address
skyler DOT soss AT gmail.com