hax icon indicating copy to clipboard operation
hax copied to clipboard

Empty clauses in match generate syntactically ill-formed code in F*

Open clementblaudeau opened this issue 7 months ago • 5 comments

As shown in this playground, the following (valid) rust code :

fn main () -> i32 {
    match (1,2) { 
     | (x, y) => y , /* note the | before the clause */
    }
}

generates the ill-formed fstar code:

let main (_: Prims.unit) : i32 =
  match
    mk_i32 1, mk_i32 2 <: (i32 & i32)
  with
  |  | x, y -> y (* double | | , ill formed *)

The empty clause is translated as an empty clause.

clementblaudeau avatar May 15 '25 11:05 clementblaudeau

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 Jul 24 '25 00:07 github-actions[bot]

This issue has been closed due to a lack of activity since being marked as stale. If you believe this issue is still relevant, please reopen it with an update or comment.

github-actions[bot] avatar Jul 31 '25 00:07 github-actions[bot]

This is still relevant

W95Psp avatar Jul 31 '25 07:07 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 09 '25 00:10 github-actions[bot]

In the THIR importer, Or clauses with a single clause should be normalized.

clementblaudeau avatar Oct 09 '25 11:10 clementblaudeau