Skip to content

Bug: syntax with dot collapses when argument is an integer #1255

@emillon

Description

@emillon

Hi,

This kind of input causes a crash in ocamlformat:

let _ = (0).*(0)

The reason is that it tries to format as something that starts with 0., which is lexed as a float.

The "canonical" example is (0).(0) which cannot happen in a well-typed way, but other similar ones might happen when redefining ( .*() ) or ( .*()<- ) and similar operators.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions