MantisBT - OCaml
View Issue Details
0007580OCamltypingpublic2017-07-06 11:022017-07-06 15:57
bobot 
dra 
highmajoralways
resolvedno change required 
4.05.0 +dev/beta1/beta2/beta3/rc1 
 
0007580: On 4.05 warning 3 seems to be inherited
The warning for deprecation seems to be inherited when functions are defined as alias:


```
  include struct
    [@@@warning "-3"]
    let capitalize_ascii = String.capitalize
    let uncapitalize_ascii = String.uncapitalize
    let uppercase_ascii = String.uppercase
    let lowercase_ascii = String.lowercase
  end
```

Jbuilder use this code for being compatible with different ocaml version, it works for older versions, but with 4.05, user of this module raise the warning 3.
No tags attached.
Issue History
2017-07-06 11:02bobotNew Issue
2017-07-06 11:26frischNote Added: 0018047
2017-07-06 11:28frischAssigned To => frisch
2017-07-06 11:28frischStatusnew => feedback
2017-07-06 11:40draNote Added: 0018048
2017-07-06 12:52bobotNote Added: 0018049
2017-07-06 12:52bobotStatusfeedback => assigned
2017-07-06 13:00frischNote Added: 0018050
2017-07-06 13:30draNote Added: 0018051
2017-07-06 14:46bobotNote Added: 0018052
2017-07-06 14:50draNote Added: 0018054
2017-07-06 14:59draNote Added: 0018055
2017-07-06 15:00draNote Added: 0018056
2017-07-06 15:01draAssigned Tofrisch => dra
2017-07-06 15:01draStatusassigned => resolved
2017-07-06 15:01draResolutionopen => no change required
2017-07-06 15:01draProduct Version => 4.05.0 +dev/beta1/beta2/beta3/rc1
2017-07-06 15:55frischNote Added: 0018057
2017-07-06 15:57draNote Added: 0018058

Notes
(0018047)
frisch   
2017-07-06 11:26   
This is probably https://caml.inria.fr/mantis/view.php?id=7444. [^] The warning is now raised on the module coercion when the deprecation marker is removed. You can either eta-expand the function or disable the warning around the coercion (e.g. write a signature around the "struct" and disable the warning for the module definition).

Are you sure this is for 4.05, not 4.06/trunk, though?
(0018048)
dra   
2017-07-06 11:40   
I'm struggling to reproduce it (probably me...) - could you expand the example to be one which definitely produces the warning?
(0018049)
bobot   
2017-07-06 12:52   
Could you add a * in the changelog?

```
- MPR#7444, GPR#1138: trigger deprecation warning when a "deprecated"
  attribute is hidden by signature coercion
  (Alain Frisch, report by bmillwood, review by Leo White)
```

Yes definitely 4.05. Th 1138#GPR is not in 4.05?

The reprocase can be the current jbuilder source (https://github.com/janestreet/jbuilder/issues/165#issuecomment-313315486 [^]), but I'm going to try to create a smaller test case.
(0018050)
frisch   
2017-07-06 13:00   
I think it's implicit that warnings can become more aggressive across version, no?

No, #1138 should not be in 4.05. Perhaps it's something else, then.
(0018051)
dra   
2017-07-06 13:30   
I can confirm I'm also seeing it with jbuilder in 4.05.0+rc1
(0018052)
bobot   
2017-07-06 14:46   
Okay, the code in jbuilder was faulty (use String.lowercase through an include in Import), I just don't understand why it does this in 4.05 and not just in trunk. I misread the reason of the error.

I still think that this changes should have a *, it just say that it is a change that can break existing programs. We can be explicit. Sorry for the noise.

The commit for jbuilder: https://github.com/janestreet/jbuilder/pull/179/commits/1297f8326951e857ecef495be5369a4f681da6ee [^]
(0018054)
dra   
2017-07-06 14:50   
I'm just finishing a bisect to look further (the change was introduced after 4.04.0 was merged back into trunk but before 4.05 was branched) just in case it's also an OCaml bug (or a missing Changes entry).

We don't normally mark changes in warnings behaviour as breaking, I think - the idea is that one should never be running -warn-error in production, so we can't break anything.
(0018055)
dra   
2017-07-06 14:59   
The change appeared in 4da2b3 (https://github.com/ocaml/ocaml/commit/4da2b3 [^]) - GPR#875 (https://github.com/ocaml/ocaml/pull/875 [^])
(0018056)
dra   
2017-07-06 15:00   
Oh - it's obvious. Jbuilder uses StringLabels and prior to this commit those functions were incorrectly not marked as deprecated!
(0018057)
frisch   
2017-07-06 15:55   
Thanks David! I think the mystery is fully resolved.
(0018058)
dra   
2017-07-06 15:57   
Indeed - I have clarified the entry for GPR#875 in 4.05/trunk Changes to mention that missing deprecation tags were added.