Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007239OCaml~DO NOT USE (was: OCaml general)public2016-04-22 11:432017-09-24 17:32
Reporterfuruse 
Assigned Togasche 
PrioritylowSeveritytextReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version4.02.3 
Target Version4.03.1+devFixed in Version4.03.1+dev 
Summary0007239: Warning 42: a case where a type constraint does not help a disambiguation
DescriptionThe following (pretty artificial) code produces Warning 42, even with disambiguation by a type constraint:

type a = C
type b = C
let a = (C : a) (* Warning 42: this use of C required disambiguation. *)
let b = (C : b)
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0015839)
garrigue (manager)
2016-04-23 12:38

Maybe the problem is with the text of the warning.
I think that the intended meaning is: C was chosen based on its type information, in absence of type information, a different choice would have been done.
And this is the case here: the default would be b's C.
The goal of this warning is to check compatibility with previous versions of ocaml (and also know whether your code depends on type information).
(0015840)
gasche (administrator)
2016-04-23 18:03

Note to self: the various disambiguation warnings would be excellent targets for the new documentation section on compiler Warnings.

I agree that changing the text to make it less confusing would be a good idea. What about:

  Warning 42: this use of C relies on type-directed disambiguation,
  it will not compile on OCaml 4.00 or earlier.
(0015843)
furuse (reporter)
2016-04-25 06:23

@gasche, it is great now I understand what Warning 42 is.
(0015845)
gasche (administrator)
2016-04-25 19:08

I propose the change in wording in
  https://github.com/ocaml/ocaml/pull/561 [^]
(0015861)
gasche (administrator)
2016-04-26 12:57

The clarified wording has been merged in 4.04. Thanks for the report!

- Issue History
Date Modified Username Field Change
2016-04-22 11:43 furuse New Issue
2016-04-22 17:30 doligez Status new => acknowledged
2016-04-22 17:30 doligez Target Version => 4.03.1+dev
2016-04-23 12:38 garrigue Note Added: 0015839
2016-04-23 18:03 gasche Note Added: 0015840
2016-04-25 06:23 furuse Note Added: 0015843
2016-04-25 10:36 frisch Severity minor => text
2016-04-25 19:08 gasche Note Added: 0015845
2016-04-26 12:57 gasche Note Added: 0015861
2016-04-26 12:57 gasche Status acknowledged => resolved
2016-04-26 12:57 gasche Fixed in Version => 4.03.1+dev
2016-04-26 12:57 gasche Resolution open => fixed
2016-04-26 12:57 gasche Assigned To => gasche
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)
2017-09-24 17:32 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker