Skip to content

Unmatched specification in opaque signature ascription causes uncaught exception #285

@zbyrn

Description

@zbyrn

Version

110.99.4 (Latest)

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

MacOS Sonoma

Processor

  • Any
  • Arm (using Rosetta)
  • PowerPC
  • Sparc
  • x86 (32-bit)
  • x86-64 (64-bit)
  • Other

System Component

Core system

Severity

Minor

Description

If a structure fails to match the signature, the core system crashes with an uncaught exception Bind. This behavior only happens when the structure uses opaque ascription :> but not :.

Transcript

[test.sml]:

structure A :> sig
  val nonexistent: int
end = struct
end
$ sml test.sml 
Standard ML of New Jersey (64-bit) v110.99.4 [built: Tue Aug 01 16:07:38 2023]
[opening test.sml]
test.sml:1.2-4.4 Error: unmatched value specification: nonexistent

uncaught exception Bind [nonexhaustive binding failure]
  raised at: ../compiler/Elaborator/elaborate/elabmod.sml:624.13-624.67
             ../compiler/Elaborator/elaborate/elabmod.sml:1363.32
             ../compiler/Basics/stats/stats.sml:198.40
             ../compiler/TopLevel/interact/evalloop.sml:45.54
             ../compiler/TopLevel/interact/evalloop.sml:306.20-306.23

Or directly in the command line:

$ sml
Standard ML of New Jersey (64-bit) v110.99.4 [built: Tue Aug 01 16:07:38 2023]
- structure A :> sig val nonexistent : int end = struct end;
stdIn:1.2-1.59 Error: unmatched value specification: nonexistent

unexpected exception (bug?) in SML/NJ: Bind [nonexhaustive binding failure]
  raised at: ../compiler/Elaborator/elaborate/elabmod.sml:624.13-624.67
             ../compiler/Elaborator/elaborate/elabmod.sml:1363.32
             ../compiler/Basics/stats/stats.sml:198.40
             ../compiler/TopLevel/interact/evalloop.sml:45.54

Expected Behavior

The system should report the error and continue.

Steps to Reproduce

- structure A :> sig val nonexistent : int end = struct end;

Additional Information

No response

Email address

byronzhong@cs.uchicago.edu

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcompilerproblem with compilerfixed-in-110.99.5issues that will be fixed in the 110.99.5 version

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions