You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 6384 Reporter:@lpw25 Assigned to:@garrigue Status: closed (set by @xavierleroy on 2015-12-11T18:26:43Z) Resolution: fixed Priority: normal Severity: minor Version: 4.01.0 Fixed in version: 4.02.0+dev Category: typing
Bug description
By hiding a .cmi file you can get an uncaught Not_found exception:
$ cat a.mli
type t = Foo | Bar
$ cat b.mli
type t = A.t
$ cat c.mli
type t = A.t = Foo | Bar
$ cat d.ml
let f (x : B.t) =
match x with
C.Foo -> true
| _ -> false
$ ocamlc a.mli b.mli c.mli
$ rm a.cmi
$ ocamlc d.ml
Fatal error: exception Not_found
The attached patch fixes this bug. The important change is that "complete_constrs" in parmatch.ml uses the type from the constructor instead of from the pattern.
It also cleans up some other code in parmatch.ml to remove some unnecessary checks that a type has a variant/record definition (since that should makes bugs like this less likely).
Original bug ID: 6384
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2015-12-11T18:26:43Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.01.0
Fixed in version: 4.02.0+dev
Category: typing
Bug description
By hiding a .cmi file you can get an uncaught Not_found exception:
The attached patch fixes this bug. The important change is that "complete_constrs" in parmatch.ml uses the type from the constructor instead of from the pattern.
It also cleans up some other code in parmatch.ml to remove some unnecessary checks that a type has a variant/record definition (since that should makes bugs like this less likely).
File attachments
The text was updated successfully, but these errors were encountered: