New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught Bind
exception in compiler with opaque signature matching
#289
Comments
Bind
exception in compiler with opaque signature matching
This issue (bug) seems to be closely related to issue 285 (Bind exception after a static signature matching error). Here is a much simpler test case that produces the Bind exception behavior.
|
There is a fairly mild fix to elabmod.sml and sigmatch.sml involving having SigMatch.matchStr return an option result which would be NONE in the case that the signature match fails, instead of a "bogus" record. This fix eliminates the uncaught Bind exceptions in Issues $285 and #289, but it has an unexpected side effect of not allowing the legacy compiler to bootstrap with an unbound lambda var exception during the init phase when compiling dummy.sml. So this weird side effect would need to be fixed before the fix could be committed. |
Committed a second, successful fix for #285 and #289. This fix introduces another severity constructor for ErrorMsg.severity, "TERMINAL". When this severity is passed to the ErrorMsg.error function, the error message is printed and ErrorMsg.Error is raised, terminating compilation. So for the two modes of signature matching failure represented by #285 (unmatched spec) and #289 (val spec type mismatch), there is no attempt to recover after the error by returning a bogus result from sigMatch. WARNING: there are several other signature matching failure modes whose treatment has not changed, so there may be other cases where recovery is attempted after a signature match failure, leading to an uncaught BIND exception in the function constrStr function in ElabMod. A full fix needs to deal with all signature match failure modes in Elaborator/modules/sigmatch.sml. |
Version
110.99.4 (Latest)
Operating System
OS Version
No response
Processor
System Component
Core system
Severity
Minor
Description
The elaborator raises a
Bind
exception when dealing with a structure that has type errors and an opaque signature.Transcript
Expected Behavior
There should not be an uncaught
Bind
exception.Steps to Reproduce
Here is the source that reproduces the bug:
Additional Information
Note that changing the
:>
to:
for the signature ascription causes the bug to disappear.Email address
jhr@cs.uchicago.edu
The text was updated successfully, but these errors were encountered: