aeneas icon indicating copy to clipboard operation
aeneas copied to clipboard

Replace unused function inputs with `_`

Open sonmarcho opened this issue 1 year ago • 0 comments

Example: The function below doesn't use its argument:

def take_slice (s : Slice U32) : Result Unit :=
  Result.ret ()

It would be better to generate:

def take_slice (_ : Slice U32) : Result Unit :=
  Result.ret ()

The only case we have to be careful about is decreases clauses in F*: those always receive all the input arguments, so we can't use _ for unused inputs in that case.

sonmarcho avatar Mar 08 '24 07:03 sonmarcho