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

Restrictions on exception match cases are too restrictive #6432

Closed
vicuna opened this issue May 19, 2014 · 0 comments
Closed

Restrictions on exception match cases are too restrictive #6432

vicuna opened this issue May 19, 2014 · 0 comments
Assignees

Comments

@vicuna
Copy link

vicuna commented May 19, 2014

Original bug ID: 6432
Reporter: @whitequark
Assigned to: @lpw25
Status: closed (set by @xavierleroy on 2015-12-11T18:27:06Z)
Resolution: duplicate
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #6422
Monitored by: @diml @yakobowski

Bug description

I have observed that often, it is convenient to combine a catchall case with an exception case, e.g.:

match ExtUnix.All.uname () with
| { ExtUnix.All.Uname.sysname = "Linux" } ->
  List.fold_left Filename.concat [xdg_config_home; app; name]
| _ | exception (ExtUnix.All.Not_available _) ->
  List.fold_left Filename.concat [home; "." ^ app; name]

However, currently, it's not possible to have a toplevel alternation between an exception case and anything else. It doesn't make sense syntactically, and it's needlessly restrictive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants