Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006638OCamltypingpublic2014-10-30 16:242017-10-05 18:02
Assigned Tofrisch 
PlatformOSOS Version
Product Version4.02.1 
Target VersionFixed in Version 
Summary0006638: docs should mention that open! also suppresses warning 33
Description [^] says:

Since OCaml 4.01, open statements shadowing an existing identifier
(which is later used) trigger the warning 44. Adding a ! character
after the open keyword indicates that such a shadowing is intentional
and should not trigger the warning.

But this code:

module M = struct type t end
open M

gives this error:

Warning 33: unused open M.

whereas this code:

module M = struct type t end
open! M

compiles fine.

Maybe we could just update the docs to say explicitly that open! also
suppresses warning 33?
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
lpw25 (developer)
2014-10-30 19:39
edited on: 2014-10-30 19:40

I think that `open!` should not suppress warning 33. If anything the semantics of `open!` (i.e. "I am deliberately shadowing a value with this open") make it even less likely that the open is not intended to be used.

garrigue (manager)
2014-10-31 02:23

Note that the new -open command line parameter also relies on "open!".
Changing the behavior for one would also change it for the other.
I tend to agree with Leo that the right behavior is not to suppress warning 33
(which is disable by default anyway), but changing the behavior for one would also change it for the other.
sliquister (reporter)
2014-10-31 04:28

We can understand open! more generally as meaning "don't complain about this open". Otherwise there is no nice way to turn off warning 33 locally in structures, and in signatures it's even worse.
xleroy (administrator)
2017-02-16 15:42

In the end I don't understand if we need to change something or not. If not, please resolve this PR. If so, let's assign it to someone and set a target version.
frisch (developer)
2017-03-16 13:03

I think it's just a plain bug that warning 33 is suppressed by open!. The fix is easy, I'll work on it.

> Note that the new -open command line parameter also relies on "open!".

Do we all agree that this command-line parameter should never raise warning 33? I think this will still be the case after the fix, since Env.open_signature will only raise warnings if passed an explicit non-ghost location.
frisch (developer)
2017-03-16 14:27 [^]

- Issue History
Date Modified Username Field Change
2014-10-30 16:24 dwang New Issue
2014-10-30 19:39 lpw25 Note Added: 0012473
2014-10-30 19:40 lpw25 Note Edited: 0012473 View Revisions
2014-10-31 02:23 garrigue Note Added: 0012474
2014-10-31 04:28 sliquister Note Added: 0012476
2014-12-22 22:16 doligez Status new => feedback
2015-01-10 00:18 doligez Target Version => 4.03.0+dev / +beta1
2016-04-12 16:14 doligez Target Version 4.03.0+dev / +beta1 => 4.03.1+dev
2017-02-16 14:01 doligez Target Version 4.03.1+dev => undecided
2017-02-16 15:42 xleroy Note Added: 0017292
2017-02-23 16:35 doligez Category OCaml documentation => Documentation
2017-02-23 16:44 doligez Category Documentation => documentation
2017-03-15 11:48 doligez Target Version undecided =>
2017-03-16 12:59 frisch Assigned To => frisch
2017-03-16 12:59 frisch Status feedback => assigned
2017-03-16 13:03 frisch Note Added: 0017687
2017-03-16 13:03 frisch Category documentation => typing
2017-03-16 14:27 frisch Note Added: 0017688
2017-03-16 14:27 frisch Target Version => 4.06.0 +dev/beta1/beta2/rc1
2017-10-05 18:02 doligez Target Version 4.06.0 +dev/beta1/beta2/rc1 =>

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker