Skip to content
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

[110.79] Compiler bug: Unify: unifyTy: arg ty lists wrong length #262

Closed
2 of 12 tasks
spamegg1 opened this issue Nov 23, 2022 · 1 comment
Closed
2 of 12 tasks

[110.79] Compiler bug: Unify: unifyTy: arg ty lists wrong length #262

spamegg1 opened this issue Nov 23, 2022 · 1 comment
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@spamegg1
Copy link

Version

Pre-110.97

Operating System

  • Any
  • Linux
  • macOS
  • Windows
  • Other Unix

OS Version

Ubuntu 22.04 Jammy

Processor

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

System Component

SML/NJ Library

Severity

Minor

Description

SML/NJ version 110.79

A "Compiler bug" is reported by the REPL whenever I make an incorrect use of the type SMLofNJ.Cont.cont that does not type-check, which I then try to use with Signals.HANDLER.

If I remove the type annotation and let it be inferred, or use 'a C.Cont instead, the "Compiler bug" report does not happen.

Transcript

Standard ML of New Jersey v110.79 [built: Sat Oct 26 12:27:04 2019]
use "test.sml";
[opening test.sml]
[autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
test.sml:5.55-5.61 Error: type constructor Cont.cont given 0 arguments, wants 1
test.sml:5.64-5.70 Error: type constructor Cont.cont given 0 arguments, wants 1
Error: Compiler bug: Unify: unifyTy: arg ty lists wrong length

uncaught exception Error
raised at: ../compiler/Basics/errormsg/errormsg.sml:52.14-52.19
../compiler/Elaborator/types/unify.sml:310.13
../compiler/Elaborator/types/unify.sml:310.13
../compiler/Elaborator/types/unify.sml:310.13
../compiler/Elaborator/types/unify.sml:310.13
../compiler/Elaborator/types/typecheck.sml:625.12
../compiler/Basics/stats/stats.sml:198.40
../compiler/Elaborator/elaborate/elabmod.sml:1741.65
../compiler/Elaborator/elaborate/elabmod.sml:1745.59
../compiler/Basics/stats/stats.sml:198.40
../compiler/TopLevel/interact/evalloop.sml:44.55
../compiler/TopLevel/interact/evalloop.sml:292.17-292.20

Expected Behavior

Not sure.

Steps to Reproduce

I tried to minimize the code. It might be possible to minimize it further.

(* this is file test.sml *)
structure S = Signals
structure C = SMLofNJ.Cont

(*   deliberately wrong type annotation here, should be 'a C.cont *)
fun interrupt_handler(signal: S.signal, n: int, cont: C.cont): C.cont = cont

fun main(arg0: string, argv: string list): OS.Process.status = (
    S.setHandler(S.sigINT, S.HANDLER interrupt_handler);
    OS.Process.success
)

Now run it on the REPL with use "test.sml";

Additional Information

No response

Email address

spamegg@pm.me

@spamegg1 spamegg1 added the bug Something isn't working label Nov 23, 2022
@JohnReppy
Copy link
Contributor

This issue has been fixed since 110.79 (110.99.3 works correctly), so I am going to close it.

@JohnReppy JohnReppy added the wontfix This will not be worked on label Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants