| Anonymous | Login | Signup for a new account | 2013-05-24 08:30 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 | |||
| 0005037 | OCaml | OCaml general | public | 2010-04-24 06:47 | 2010-04-30 17:23 | |||
| Reporter | kaustuv | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | major | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | ||||||||
| Target Version | Fixed in Version | 3.12.0+dev | ||||||
| Summary | 0005037: 3.12.0+dev18: "module type of" produces unusable signatures for repeated definitions | |||||||
| Description | # module type S = module type of (struct let x = 42 let x = "abc" end) ;; module type S = sig val x : int val x : string end # module T : S = struct let x = "abc" end ;; Characters 15-39: module T : S = struct let x = "abc" end ;; ^^^^^^^^^^^^^^^^^^^^^^^^ Error: Signature mismatch: Modules do not match: sig val x : string end is not included in S Values do not match: val x : string is not included in val x : int These don't work either: # module T : S = struct let x = 42 end ;; # module T : S = struct let x = 42 let x = "abc" end ;; Since repeated module level definitions with the same name are very common, "module type of" should use the same heuristic as "sig ... end" and retain only the last one of repeated definitions. | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Relationships |
|||||||||||||||||||||
|
|||||||||||||||||||||
Notes |
|
|
(0005373) Julien Signoles (reporter) 2010-04-26 13:39 |
This issue is not specific to "module type of". See BTS entries 0001441, 0004487 and 0004974. |
|
(0005376) kaustuv (reporter) 2010-04-26 13:50 |
0001441 and 0004487 are not relevant because their error conditions are no longer reproducible: # module type S = sig val x : int val x : string end ;; module type S = sig val x : string end That is, it appears that sig ... end now drops all but the last of duplicate definitions. 0004974 is possibly not relevant either, but there isn't enough code there for me to judge. |
|
(0005379) kaustuv (reporter) 2010-04-26 17:49 |
Attached patch against r10311 that suggests a possible fix. There is probably a better way to do it, though. |
|
(0005397) garrigue (manager) 2010-04-28 07:04 |
Just needed to call simplify_modtype on the generated signature. Fixed for 3.12. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2010-04-24 06:47 | kaustuv | New Issue | |
| 2010-04-26 13:39 | Julien Signoles | Note Added: 0005373 | |
| 2010-04-26 13:50 | kaustuv | Note Added: 0005376 | |
| 2010-04-26 17:48 | kaustuv | File Added: signature-duplicate-filtering.patch | |
| 2010-04-26 17:49 | kaustuv | Note Added: 0005379 | |
| 2010-04-28 07:04 | garrigue | Note Added: 0005397 | |
| 2010-04-28 07:04 | garrigue | Status | new => closed |
| 2010-04-28 07:04 | garrigue | Resolution | open => fixed |
| 2010-04-28 07:04 | garrigue | Fixed in Version | => 3.12.0+dev |
| 2010-04-30 17:22 | doligez | Relationship added | related to 0001441 |
| 2010-04-30 17:23 | doligez | Relationship added | related to 0004487 |
| 2010-04-30 17:23 | doligez | Relationship added | related to 0004974 |
| 2011-06-01 22:54 | doligez | Relationship added | related to 0005061 |
| Copyright © 2000 - 2011 MantisBT Group |