Skip to content

Struct SynType.Tuple has invalid range #13831

@auduchinok

Description

@auduchinok

Consider struct tuple type annotation:

let _: struct (int * int) = ()

After #13440 the type range doesn't include struct ( and ) anymore (ast), despite they are parsed as part of the corresponding rules:

fsharp/src/Compiler/pars.fsy

Lines 5284 to 5287 in bdb6462

| STRUCT LPAREN appType STAR tupleOrQuotTypeElements rparen
{ let mStar = rhs parseState 4
let path = SynTupleTypeSegment.Type $3 :: SynTupleTypeSegment.Star mStar :: $5
mkSynTypeTuple true path }

fsharp/src/Compiler/pars.fsy

Lines 5289 to 5293 in bdb6462

| STRUCT LPAREN appType STAR tupleOrQuotTypeElements recover
{ reportParseErrorAt (rhs parseState 2) (FSComp.SR.parsUnmatchedParen())
let mStar = rhs parseState 4
let path = SynTupleTypeSegment.Type $3 :: SynTupleTypeSegment.Star mStar :: $5
mkSynTypeTuple true path }

cc @edgarfgp @nojaf

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions