8000 Bogus `sharing type` raises an internal exception · Issue #346 · smlnj/legacy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bogus sharing type raises an internal exception #346

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

Open
2 of 12 tasks
zbyrn opened this issue Feb 10, 2025 · 1 comment
Open
2 of 12 tasks

Bogus sharing type raises an internal exception #346

zbyrn opened this issue Feb 10, 2025 · 1 comment
Assignees
Labels
bug Something isn't working compiler problem with compiler

Comments

@zbyrn
Copy link
Contributor
zbyrn commented Feb 10, 2025

Version

110.99.7.1 (Latest)

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

No response

Processor

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

System Component

Core system

Severity

Cosmetic

Description

The Definition (p. 15, fig. 7) defines the syntax for sharing as follows:

spec ::= ...
         <empty>
         <spec> ; <spec>
         <spec> sharing type <longtycon_1> = ... = <longtycon_n>

Since empty strings are acceptable specs, there can be an empty spec preceding the keyword sharing.

While the parser successfully parses the following string, the type checker raises an internal exception.

structure T :> sig sharing type a = b end = struct end;

Transcript

Standard ML of New Jersey [Version 110.99.7.1; 64-bit; January 17, 2025]
- structure T :> sig sharing type a = b end = struct end;
stdIn:1.34-1.39 Error: nonlocal path in type sharing: a
stdIn:1.34-1.39 Error: nonlocal path in type sharing: b
Error: Compiler bug: SigMatch:checkSharing:checkTyc
-

Expected Behavior

Report the errors gracefully.

Steps to Reproduce

structure T :> sig sharing type a = b end = struct end;

Additional Information

No response

Email address

byronzhong@cs.uchicago.edu

@zbyrn zbyrn added the bug Something isn't working label Feb 10, 2025
@JohnReppy JohnReppy added the compiler problem with compiler label Apr 3, 2025
@dmacqueen
Copy link
Contributor

Thanks for pointing this out! This is a syntax design error made back in the 1980s, and I am probably responsible for letting it sneak in by not paying sufficient attention, but it is a bit late to fix it since the "Revised" book was published 28 years ago. Could possibly be fixed in the online copy of the Definition, and we could create an Errata page for the definition (which would have been, and still is, a good idea!).

Meanwhile, I will take care not to repeat this mistake in my MsML design. I may not even include sharing equations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler problem with compiler
Projects
None yet
Development

No branches or pull requests

3 participants
0