Version
110.99.7.1 (Latest)
Operating System
OS Version
Ubuntu on WSL2
Processor
System Component
Core system
Severity
Minor
Description
Using Unsafe.cast to implement polymorphic recursion cases the error Error: Compiler bug: Contract: UsageMap on v358 on current version of SML/NJ.
See gist here
Transcript
$ sml < val-rec-polyrec2.sml
Standard ML of New Jersey [Version 110.99.7.1; 64-bit; January 17, 2025]
- = [autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
Error: Compiler bug: Contract: UsageMap on v358
...
Expected Behavior
$ /usr/bin/sml < val-rec-polyrec2.sml
Standard ML of New Jersey v110.79 [built: Sat Oct 26 12:27:04 2019]
- = [autoloading]
[library $SMLNJ-BASIS/basis.cm is stable]
[library $SMLNJ-BASIS/(basis.cm):basis-common.cm is stable]
[autoloading done]
datatype 'a nested = Epsilon | Nest of 'a * 'a list nested
val sumListWith = fn : ('a -> int) -> 'a list -> int
val go = fn : ('a -> int) * 'a nested * int -> int
val sum = fn : int nested -> int
val nested = Nest (1,Nest ([#,#,#],Nest #)) : int nested
val nestedSum = 45 : int
Steps to Reproduce
See gist
Additional Information
No response
Email address
skyler DOT soss AT gmail DOT com
Version
110.99.7.1 (Latest)
Operating System
OS Version
Ubuntu on WSL2
Processor
System Component
Core system
Severity
Minor
Description
Using
Unsafe.castto implement polymorphic recursion cases the errorError: Compiler bug: Contract: UsageMap on v358on current version of SML/NJ.See gist here
Transcript
Expected Behavior
Steps to Reproduce
See gist
Additional Information
No response
Email address
skyler DOT soss AT gmail DOT com