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

Short form of local open is not available in patterns #6721

Closed
vicuna opened this issue Dec 17, 2014 · 3 comments
Closed

Short form of local open is not available in patterns #6721

vicuna opened this issue Dec 17, 2014 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Dec 17, 2014

Original bug ID: 6721
Reporter: @whitequark
Assigned to: @whitequark
Status: closed (set by @whitequark on 2014-12-17T16:41:55Z)
Resolution: duplicate
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #6656
Monitored by: @gasche @hcarty

Bug description

I think it could be useful to have local open also available in patterns.
E.g.:

match reply with
| `Ok Service.{host; port} -> ...
| `Error -> ...
@vicuna
Copy link
Author

vicuna commented Dec 17, 2014

Comment author: @yallop

I agree that this would be useful, but that particular example can be written

match reply with
| Ok {Service.host; port} -> ... | Error ->

@vicuna
Copy link
Author

vicuna commented Dec 17, 2014

Comment author: @whitequark

Sure. It's more useful with deeply nested patterns (like in Parsetree), or as Mod.[].

@vicuna
Copy link
Author

vicuna commented Dec 17, 2014

Comment author: @hcarty

FYI - This was reported in #6656

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

1 participant