|Anonymous | Login | Signup for a new account||2015-10-07 08:39 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0006090||OCaml||OCaml typing||public||2013-07-26 20:42||2013-07-31 04:57|
|Target Version||Fixed in Version||4.01.0+dev|
|Summary||0006090: Module constraint + private type seems brocken in ocaml 4.01.0|
|Description||The following test-case doesn't compile using ocaml-4.01.0 but does compile with older versions.|
It produce the following error:
Error: This variant or record definition does not match that of type Test.t
A private type would be revealed.
|Steps To Reproduce||module Test = struct type t = private A end|
module Test2 : module type of Test with type t = Test.t = Test
|Tags||No tags attached.|
Actually, I wonder which older versions you are talking about.
I tested with 3.12.1 and 4.00.1, and in both cases your code is refused
(albeit for a different reason).
This said, now that a with constraint adds equations rather than overwrite
the original definition, it makes sense to allow this.
This is now accepted in 4.01 and trunk (revisions 13936 and 13937)
Ok, sorry. It was a wrong test-case. But, good news, it seems to fix the original case. So, thanks.
The original case was in eliom, in this file line 100:
and it fails to compile with 4.01.0 with the same error than the test-case (after replacing Test.t with Xml.acontent).
For backward compatibility reasons, we need to allow using private in the with clause in that case:
module Test = struct type t = private A end
module Test2 : (module type of Test with type t = private Test.t) = Test
This was the only way to obtain the expected behavior in 3.12 and 4.00, and is used actively in Core.
I have added a deprecation warning in trunk (but not 4.00), since this use of private is not semantically correct.
|2013-07-26 20:42||jpdeplaix||New Issue|
|2013-07-27 01:07||garrigue||Note Added: 0009877|
|2013-07-27 01:07||garrigue||Status||new => resolved|
|2013-07-27 01:07||garrigue||Fixed in Version||=> 4.01.0+dev|
|2013-07-27 01:07||garrigue||Resolution||open => fixed|
|2013-07-27 01:07||garrigue||Assigned To||=> garrigue|
|2013-07-27 15:44||jpdeplaix||Note Added: 0009896|
|2013-07-31 04:57||garrigue||Note Added: 0010034|
|Copyright © 2000 - 2011 MantisBT Group|