Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007695OCamltypingpublic2017-12-21 23:352018-04-09 17:03
Reportercopy 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version4.06.0 
Target Version4.07.0+dev/beta2Fixed in Version4.07.0+dev/beta2 
Summary0007695: Fatal error: exception Ctype.Unify(_)
DescriptionThe following code produce a compiler error ("Fatal error: exception Ctype.Unify(_)").

let _ =
  let arb = QCheck.char in
  let gen = QCheck.Gen.int in
  { arb with gen }
Steps To Reproduce1. Install qcheck 0.7 (opam install qcheck)
2. Save the code as test.ml
3. Run: ocamlfind ocamlc -c -package qcheck test.ml
TagsNo tags attached.
Attached Files

- Relationships
has duplicate 0007766resolvedoctachron Fatal error: exception Ctype.Unify(_) 
child of 0006608resolvedgarrigue Lax typing for functional record updates 

-  Notes
(0018768)
nojebar (developer)
2017-12-21 23:50

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(_)
$
(0018769)
nojebar (developer)
2017-12-22 00:05
edited on: 2017-12-22 00:07

Bug introduced in https://github.com/ocaml/ocaml/commit/844016f58b6ad1f5c4d908180de676011ed15d45 [^]
(MPR 0006608).

(0018770)
garrigue (manager)
2017-12-22 04:16

Thanks @nojebar.
Here is a PR that fixes the problem: https://github.com/ocaml/ocaml/pull/1541 [^]

Note that the output of the test is no there yet, as expect tests do not seem to work currently...
(0018771)
garrigue (manager)
2017-12-22 04:26

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.
(0018797)
xleroy (administrator)
2017-12-28 19:37

GPR merged in trunk, will be in 4.07

- Issue History
Date Modified Username Field Change
2017-12-21 23:35 copy New Issue
2017-12-21 23:50 nojebar Note Added: 0018768
2017-12-21 23:50 nojebar Assigned To => nojebar
2017-12-21 23:50 nojebar Status new => acknowledged
2017-12-22 00:05 nojebar Note Added: 0018769
2017-12-22 00:05 nojebar Note Edited: 0018769 View Revisions
2017-12-22 00:05 nojebar Note Edited: 0018769 View Revisions
2017-12-22 00:07 nojebar Note Edited: 0018769 View Revisions
2017-12-22 04:13 garrigue Assigned To nojebar => garrigue
2017-12-22 04:13 garrigue Status acknowledged => assigned
2017-12-22 04:16 garrigue Note Added: 0018770
2017-12-22 04:26 garrigue Note Added: 0018771
2017-12-22 07:06 nojebar Relationship added child of 0006608
2017-12-28 19:37 xleroy Note Added: 0018797
2017-12-28 19:37 xleroy Status assigned => resolved
2017-12-28 19:37 xleroy Resolution open => fixed
2017-12-28 19:37 xleroy Fixed in Version => 4.07.0+dev/beta2
2017-12-28 19:37 xleroy Target Version => 4.07.0+dev/beta2
2018-04-09 17:03 octachron Relationship added has duplicate 0007766


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker