| Anonymous | Login | Signup for a new account | 2013-05-24 04:18 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0005057 | OCaml | OCaml general | public | 2010-05-20 14:47 | 2010-05-21 03:27 | |||
| Reporter | ygrek | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.11.2 | |||||||
| Target Version | Fixed in Version | 3.12.0+dev | ||||||
| Summary | 0005057: fatal typing error with local module + functor + polymorphic variant | |||||||
| Description | $ cat bug.ml module TT = struct module IntSet = Set.Make(struct type t = int let compare = compare end) end let () = let f flag = let module T = TT in let _ = match flag with `A -> 0 | `B r -> r in let _ = match flag with `A -> T.IntSet.mem | `B r -> r in () in f () $ ocamlc -c bug.ml Fatal error: exception Ctype.Unify(_, _) $ ocamlc -version 3.11.2 | |||||||
| Additional Information | This is a minimized example, originally occurred in real sensible code. Also reported to fail in 3.12.0+dev17 | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0005478) garrigue (manager) 2010-05-21 03:27 |
The correct code should be "f `A" :-) There was a bug in the handling of levels inside polymorphic variant fields. This is now fixed for 3.12. Note that your report helped discover a more serious problem, where the following code was wrongly accepted. Thank you very much. let f flag = let module T = Set.Make(struct type t = int let compare = compare end) in let _ = match flag with `A -> 0 | `B r -> r in let _ = match flag with `A -> T.mem | `B r -> r in () |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2010-05-20 14:47 | ygrek | New Issue | |
| 2010-05-21 03:27 | garrigue | Note Added: 0005478 | |
| 2010-05-21 03:27 | garrigue | Status | new => closed |
| 2010-05-21 03:27 | garrigue | Resolution | open => fixed |
| 2010-05-21 03:27 | garrigue | Fixed in Version | => 3.12.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |