Skip to content

Bug: (*) is formatted without spaces in some contexts #1249

@emillon

Description

@emillon

Hi,

In most cases ( * ) is formatted with spaces (that's necessary because otherwise it clashes with comment syntax).

But here's a case where it's not:

let op = if b then ( * ) else ( + ) in ()

It gets formatted as if true then (*) else (+), which crashes ocamlformat.

This seems to be related to the ~parens:false param.

This also happens in the following contrived example (which might indicate a larger problem):

assert ( * )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions