Skip to content

Instantly share code, notes, and snippets.

@eldesh
Created May 1, 2014 04:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eldesh/7e61fc911a01ed464cb3 to your computer and use it in GitHub Desktop.
Save eldesh/7e61fc911a01ed464cb3 to your computer and use it in GitHub Desktop.
SML#1.2.0 でウソのシグネチャ(型注釈)がコンパイルを通るバグ。(SML#2.0.0では修正済み)
_require "basis.smi"
structure B =
struct
val g : {dir:string, name:string} -> unit
end
structure B =
struct
fun g (dir, name) = print (concat[dir, "/", name, "\n"])
end
_require "basis.smi"
_require "body.smi"
structure Main =
struct
fun main () =
B.g {dir="sml", name="sharp"}
end
val () = Main.main ()
#!/bin/sh
# smlsharp v1.2.0
smlsharp -c body.sml
smlsharp -c main.sml
smlsharp -o main main.smi
./main
# smlsharp 1.2.0 (not 2.0.0) accept these code (o_O)
# $ ./run.sh
# sml/sharp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment