Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007580OCamltypingpublic2017-07-06 11:022017-07-06 15:57
Reporterbobot 
Assigned Todra 
PriorityhighSeveritymajorReproducibilityalways
StatusresolvedResolutionno change required 
PlatformOSOS Version
Product Version4.05.0 +dev/beta1/beta2/beta3/rc1 
Target VersionFixed in Version 
Summary0007580: On 4.05 warning 3 seems to be inherited
DescriptionThe 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.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0018047)
frisch (developer)
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 (developer)
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 (reporter)
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 (developer)
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 (developer)
2017-07-06 13:30

I can confirm I'm also seeing it with jbuilder in 4.05.0+rc1
(0018052)
bobot (reporter)
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 (developer)
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 (developer)
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 (developer)
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 (developer)
2017-07-06 15:55

Thanks David! I think the mystery is fully resolved.
(0018058)
dra (developer)
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.

- Issue History
Date Modified Username Field Change
2017-07-06 11:02 bobot New Issue
2017-07-06 11:26 frisch Note Added: 0018047
2017-07-06 11:28 frisch Assigned To => frisch
2017-07-06 11:28 frisch Status new => feedback
2017-07-06 11:40 dra Note Added: 0018048
2017-07-06 12:52 bobot Note Added: 0018049
2017-07-06 12:52 bobot Status feedback => assigned
2017-07-06 13:00 frisch Note Added: 0018050
2017-07-06 13:30 dra Note Added: 0018051
2017-07-06 14:46 bobot Note Added: 0018052
2017-07-06 14:50 dra Note Added: 0018054
2017-07-06 14:59 dra Note Added: 0018055
2017-07-06 15:00 dra Note Added: 0018056
2017-07-06 15:01 dra Assigned To frisch => dra
2017-07-06 15:01 dra Status assigned => resolved
2017-07-06 15:01 dra Resolution open => no change required
2017-07-06 15:01 dra Product Version => 4.05.0 +dev/beta1/beta2/beta3/rc1
2017-07-06 15:55 frisch Note Added: 0018057
2017-07-06 15:57 dra Note Added: 0018058


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker