Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000295OCamlOCaml generalpublic2001-02-27 10:522001-03-05 03:39
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000295: Re: problems with OCaml 3.01 beta
DescriptionDear Manuel,

Thanks for the beta-testing!

> 1) The file byterun/makefile.nt needs to be fixed by adding backtrace.obj to
> the OBJ list.

Oups, sorry. I've fixed this.

> 2) Compiling our Vault compiler with the new version, I noticed that
> camldepend seems to be less smart about local modules with the same name as
> some global module. E.g., I had a module env.ml containing a functor called
> ENV(...).
> Camldepend generated a self-dependency on env.cmo.
>
>
> 3) More seriously, I'm getting a type error where I did not used to get one.
> It seems that Ocaml considers some types to be distinct where they were not
> before, although I'm confused as to why. Here's the error.
>
> File "typing/typematch.ml", line 1778, characters 4-19:
> This pattern matches values of type Types.presence * ([< `Absent] as 'a)
> but is here used to match values of type Types.presence * Types.presence
> Type 'a is not compatible with type
> Types.presence = [ `Present of Types.state * Types.type_expr | `Absent]
>
> If I understand it correctly, the compiler complains that `Absent does not
> match Types.presence, whereas it should. The error was generated in a
> pattern match of the form:
>
> match p1,p2 with
> `Absent,`Absent -> ()
> | `Present (s1,ty1), `Present (s2,ty2) ->
> unify_state (Some r) unif assm env modpath s1 s2;
> begin try
> unify unif assm env modpath ty1 ty2
> with
> Unify(cause,env,c1,c2) ->
> raise (Unify(`RsrcType(r,cause),env,c1,c2))
> end
> | `Absent, _ ->
> raise (Unify(`Missing r, env, `CCap c1, `CCap c2))
> | _, `Absent ->
> raise (Unify(`Extra r, env, `CCap c1, `CCap c2))
>
>
> That's a showstopper for me.

We will look into this.

Cheers,

- Xavier

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000515)
administrator (administrator)
2001-03-05 03:39

Fixed by change in the typing of variant matching. Jacques, 2001-03-03.
(0000516)
administrator (administrator)
2001-03-05 11:33

> > 3) More seriously, I'm getting a type error where I did not used to get one.
> > It seems that Ocaml considers some types to be distinct where they were not
> > before, although I'm confused as to why. Here's the error.
> >
> > match p1,p2 with
> > `Absent,`Absent -> ()
> > | `Present (s1,ty1), `Present (s2,ty2) ->
> > unify_state (Some r) unif assm env modpath s1 s2;
> > begin try
> > unify unif assm env modpath ty1 ty2
> > with
> > Unify(cause,env,c1,c2) ->
> > raise (Unify(`RsrcType(r,cause),env,c1,c2))
> > end
> > | `Absent, _ ->
> > raise (Unify(`Missing r, env, `CCap c1, `CCap c2))
> > | _, `Absent ->
> > raise (Unify(`Extra r, env, `CCap c1, `CCap c2))

I'm a bit surprised that this worked at all before, because I do not
remember any major change there, and multiple matching of variants
with wild patterns on both sides was rather imprevisible.
But anyway this has just been corrected as a side-effect of a bigger
change on how to use exhaustivity information from the match compiler
in typing (namely, do not discard tags explicitely matched from the
synthesized type), to get more previsibility.

Yet, this issue is still in discussion, and the semantics of _ might
change, so mark this code as fragile, as it might need to be adapted
in the future. And inform us if anything strange happens.

   Jacques


- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker