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

Support Module.[], .{}, etc. in pattern matches #6656

Closed
vicuna opened this issue Nov 11, 2014 · 6 comments
Closed

Support Module.[], .{}, etc. in pattern matches #6656

vicuna opened this issue Nov 11, 2014 · 6 comments

Comments

@vicuna
Copy link

vicuna commented Nov 11, 2014

Original bug ID: 6656
Reporter: @hcarty
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-09-24T15:32:53Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 4.02.1
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: ~DO NOT USE (was: OCaml general)
Tags: junior_job
Has duplicate: #6721
Monitored by: @gasche @yallop @hcarty

Bug description

We recently gained support for local module opens for M.[], M.{} and a few similar constructs. It would be nice to have the same support when matching values.

Steps to reproduce

A simple example that does not work with 4.02.1 but would be nice to have:

let c = Complex.{ re = 1.0; im = 1.0 } in match l with Complex.{re} -> re

@vicuna
Copy link
Author

vicuna commented Nov 11, 2014

Comment author: @yallop

I'd like to see this as well, but note that the particular example you give can be written equally concisely without the new feature:

let c = Complex.{ re = 1.0; im = 1.0 } in match c with {Complex.re} -> re

@vicuna
Copy link
Author

vicuna commented Nov 12, 2014

Comment author: @hcarty

True - I was trying to give a concise example but I probably should have picked something more compelling.

@vicuna
Copy link
Author

vicuna commented Sep 16, 2015

Comment author: @gasche

There is a pull request to this effect in

#187

@vicuna
Copy link
Author

vicuna commented May 10, 2016

Comment author: @Octachron

The final implementation details are here: #578. This final implementation was merged in trunk at commit 2d33e16.

@vicuna
Copy link
Author

vicuna commented May 10, 2016

Comment author: @gasche

Thanks for the triaging help!

@vicuna
Copy link
Author

vicuna commented May 10, 2016

Comment author: @hcarty

Thanks to everyone involved!

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