Skip to content

Allow closing '>' of multiline nested type arguments to align with the opener (#15171)#20003

Open
edgarfgp wants to merge 3 commits into
dotnet:mainfrom
edgarfgp:fix-15171-multiline-typeargs
Open

Allow closing '>' of multiline nested type arguments to align with the opener (#15171)#20003
edgarfgp wants to merge 3 commits into
dotnet:mainfrom
edgarfgp:fix-15171-multiline-typeargs

Conversation

@edgarfgp

@edgarfgp edgarfgp commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem

A nested, multiline type-argument list fails to parse when the inner closing > is aligned with the column of the opening type name. Adding one extra space before the > avoids it.

Fixes #15171.

Before

type Terminal =
    abstract onKey:
        IEvent<
            Foo<
                Bar * int
            >          // aligned with 'Foo' → error FS0010: Incomplete structured construct ... in type arguments
        > with get, set

After

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

Cause

The closing > at the same column as the enclosing sequence block's start, on a later line, was treated as a block separator (OBLOCKSEP), which broke the type-argument parse. A closing > of a type application is a closing bracket like ) or ], so it now belongs in isSeqBlockElementContinuator alongside RPAREN/RBRACK/RBRACE. Scoped to GREATER true (the type-app close), so the > comparison operator is unaffected.

…e opener (dotnet#15171)

A nested multiline type-argument list whose closing '>' was aligned with the
column of the opening type name was rejected with FS0010, because the '>' at
the block-start column was treated as a sequence-block separator (OBLOCKSEP).

A closing '>' of a type-application is a closing bracket like ')' or ']', so
add it to isSeqBlockElementContinuator (scoped to GREATER true, the type-app
close, leaving the '>' comparison operator unaffected).
@github-actions

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/11.0.100.md No current pull request URL (#20003) found, please consider adding it

@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

Multiline type arguments parse issue

1 participant