New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unbound constructor Pervasives.None ... #2553
Comments
Comment author: administrator
As you can check in the documentation the option type is not defined So this is rather a (mis)feature than a bug. -- |
Comment author: administrator Feature |
Comment author: administrator On Thu, May 06, 2004 at 03:07:16PM +0200, Luc Maranget wrote:
I know it's not in Pervasives, but the problem is, it's nowhere with a I know a solution would be : -----my.ml----- let none = None open Mod let my_correctedbug () = ----/my.ml----- but it's ugly and not very convenient -PH -----BEGIN PGP SIGNATURE----- iD8DBQFAmkJGvGr7W6HudhwRAhODAKCGXApe4kZChMnQM09MHAnYLbqFywCcCEO+ |
Comment author: administrator
[...]
I agree that it's ugly. The problem is known---there are a few other This could be fixed of course, but the fix for all cases is not just I still hope that this will be fixed one day...
|
Original bug ID: 2553
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Pierre HABOUZIT
Version: 3.07
OS: linux
Submission from: amaretto.inria.fr (128.93.8.127)
if you define a type as :
type foo = BarInt of int | BarChar of char | None
in a module "mod", then, if you are using options in another module that make an
«open Mod» it's not possible to access the option 'None' constructor :
open Mod
let my_bug () =
let a = ref None in
...
a := Some 0;
...
will not compile, and fail with :
-> This expression has type Mod.foo but is here used with type 'a option
this is ok. but if you correct the previous thing, with :
let my_bug () =
let a = ref Pervasives.None in ...
you get an :
-> Unbound constructor Pervasives.None
The text was updated successfully, but these errors were encountered: