fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Multiline type arguments parse issue

Open nojaf opened this issue 2 years ago • 0 comments

Hello,

I believe we may have found a lexer bug.

Repro steps

type Terminal =
    abstract onKey:
        IEvent<
            Foo<
                Bar * int
             >
        > with get, set

    abstract onKey2:
        IEvent<
            Foo<
                Bar * int
            >
        > with get, set

onKey is valid code while onKey2 is not. (online tool).

The difference is that onKey has an additional space before the closing > of Foo. In both cases, there is no problem with IEvent. So it only seems to manifest itself in nested situations.

Expected behaviour

I'm not sure if this needs another relaxation, but I assume the alignment of the identifier and closing > is allowed.

Actual behaviour

In nested scenarios, this doesn't appear to be the case.

Known workarounds

Adding one extra space avoids the problem.

Related information

See https://github.com/fsprojects/fantomas/pull/2852

nojaf avatar May 02 '23 13:05 nojaf