fsharp
fsharp copied to clipboard
Multiline type arguments parse issue
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