Skip to content

Commit c4b40cb

Browse files
committed
new parser production rule.
1 parent 9b4a7ce commit c4b40cb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/Compiler/pars.fsy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,6 +3574,17 @@ headBindingPattern:
35743574
let pat2 = SynPat.Wild(mColonColon.EndRange)
35753575
SynPat.ListCons($1, pat2, rhs2 parseState 1 2, { ColonColonRange = mColonColon }) }
35763576

3577+
| headBindingPattern COLON typeWithTypeConstraints %prec paren_pat_colon
3578+
{ let mLhs = lhs parseState
3579+
SynPat.Typed($1, $3, mLhs) }
3580+
3581+
| headBindingPattern COLON recover
3582+
{ let mColon = rhs parseState 2
3583+
if not $3 then
3584+
reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
3585+
let ty = SynType.FromParseError(mColon.EndRange)
3586+
SynPat.Typed($1, ty, lhs parseState) }
3587+
35773588
| tuplePatternElements %prec pat_tuple
35783589
{ let pats, commas = $1
35793590
let pats, commas = normalizeTuplePat pats commas

0 commit comments

Comments
 (0)