Skip to content

Multiline type arguments parse issue #15171

@nojaf

Description

@nojaf

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 fsprojects/fantomas#2852

Metadata

Metadata

Assignees

Labels

Area-Compiler-Syntaxlexfilter, indentation and parsingBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions