Skip to content
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

Bug in pattern matching #2862

Closed
vicuna opened this issue Jul 27, 2001 · 1 comment
Closed

Bug in pattern matching #2862

vicuna opened this issue Jul 27, 2001 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Jul 27, 2001

Original bug ID: 454
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Luc HABERT
Version: 3.01
OS: Linux
Submission from: bastet.loria.fr (152.81.7.147)

This message may be redundant with fixed/342, but I am not sure, so I prefer to
repeat it.

The following program :

type a=
| A of c
| B of c

and c={lvar:int; lassoc: c;lnb:int}

let foo=function
| (A {lnb=i}|B {lnb=i}) when i=0 -> ()
| A {lassoc=({lnb=j});lnb=i} ->()
| _ -> ()

causes the compiler (as well ocamlc as ocamlopt) to crash with the message :

Fatal error: Matching.filter_ctx
Uncaught exception: Misc.Fatal_error

If I remove the field lvar in the definition of c, then I get :

Uncaught exception: File "bytecomp/matching.ml", line 0, characters 2139-2151:
Assertion failed

This bug occurs only if the first two cases of the match are present in this
order
.

@vicuna
Copy link
Author

vicuna commented Jul 27, 2001

Comment author: administrator

Luc: Fixed 2001-07-21
Nasty record in pattern bug.

@vicuna vicuna closed this as completed Jul 27, 2001
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant