Skip to content

Instantly share code, notes, and snippets.

@gsg
Created December 11, 2015 13:14
Show Gist options
  • Save gsg/706a43593e77a8f508f8 to your computer and use it in GitHub Desktop.
Save gsg/706a43593e77a8f508f8 to your computer and use it in GitHub Desktop.
type abc = [`A | `B | `C]
let f (x:abc) = 0
let needs_coercing : [< `A | `B] = `A
(* Type error *)
let _ = f needs_coercing
(* OK *)
let _ = f (needs_coercing :> abc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment