You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, looking at the code, I think that the logic could be better: i.e., first refine the return type for absent fields, and then use this information to type overridden fields.
But this is another story.
Activity
vicuna commentedon Dec 21, 2017
Comment author: @nojb
Simpler repro
$ rlwrap ocaml
OCaml version 4.06.0
type 'a t = { f : 'a; g : 'a };;
type 'a t = { f : 'a; g : 'a; }
let x = { f = 12; g = 43 };;
val x : int t = {f = 12; g = 43}
{x with f = "hola"};;
Fatal error: exception Ctype.Unify(_)
$
vicuna commentedon Dec 21, 2017
Comment author: @nojb
Bug introduced in 844016f
(MPR #6608).
vicuna commentedon Dec 22, 2017
Comment author: @garrigue
Thanks @nojebar.
Here is a PR that fixes the problem: #1541
Note that the output of the test is no there yet, as expect tests do not seem to work currently...
vicuna commentedon Dec 22, 2017
Comment author: @garrigue
Also, looking at the code, I think that the logic could be better: i.e., first refine the return type for absent fields, and then use this information to type overridden fields.
But this is another story.
vicuna commentedon Dec 28, 2017
Comment author: @xavierleroy
GPR merged in trunk, will be in 4.07