Skip to content

Instantly share code, notes, and snippets.

@mjambon
Created August 31, 2015 05:26
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 mjambon/e90d15ab740f632efd73 to your computer and use it in GitHub Desktop.
Save mjambon/e90d15ab740f632efd73 to your computer and use it in GitHub Desktop.
Record field disambiguation fail
type t1 = { x: int; y: int }
type t2 = { x: int; z: int }
let f () = { x = 1; y = 0 }
(* no error *)
let () =
f () |> fun x ->
ignore x.x;
ignore x.y
let wrap f x = f x
(* type error *)
let () =
f () |> wrap (fun x ->
ignore x.x;
ignore x.y
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment