hax icon indicating copy to clipboard operation
hax copied to clipboard

Phase to desugar as patterns (`x @ subpattern`)

Open W95Psp opened this issue 1 year ago • 7 comments

Some backends (e.g. F*) don't support as patterns, and reject them. For instance:

fn f(x: Option<u8>) -> u8 {
    match x {
        _binder @ Some(x) => x,
        _ => 0,
    }
}

We should have a phase that rewrites such matches. With the new phase @maximebuyse added that rewrites if let-guards, this comes for almost free: we could for instance rewrite binder @ Some(x) as binder if let Some(x) = binder.

W95Psp avatar Aug 08 '24 06:08 W95Psp

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Oct 08 '24 02:10 github-actions[bot]

Still relevant

W95Psp avatar Oct 14 '24 06:10 W95Psp

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar Dec 14 '24 02:12 github-actions[bot]

This issue has been marked as stale due to a lack of activity for 60 days. If you believe this issue is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days.

github-actions[bot] avatar May 22 '25 00:05 github-actions[bot]

Still relevant

W95Psp avatar Jul 03 '25 06:07 W95Psp