@@ -3683,9 +3683,10 @@ constrPattern:
36833683 { let m = unionRanges (rhs parseState 1) $2.Range
36843684 SynPat.IsInst($2, m) }
36853685
3686- | COLON_QMARK ends_coming_soon_or_recover %prec pat_isinst
3686+ | COLON_QMARK recover %prec pat_isinst
36873687 { let mColon = rhs parseState 1
3688- reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
3688+ if not $2 then
3689+ reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
36893690 let ty = SynType.FromParseError(mColon.EndRange)
36903691 SynPat.IsInst(ty, mColon) }
36913692
@@ -3868,9 +3869,10 @@ parenPattern:
38683869 { let mLhs = lhs parseState
38693870 SynPat.Typed($1, $3, mLhs) }
38703871
3871- | parenPattern COLON ends_coming_soon_or_recover
3872+ | parenPattern COLON recover
38723873 { let mColon = rhs parseState 2
3873- reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
3874+ if not $3 then
3875+ reportParseErrorAt mColon (FSComp.SR.parsExpectingPattern ())
38743876 let ty = SynType.FromParseError(mColon.EndRange)
38753877 SynPat.Typed($1, ty, unionRanges $1.Range mColon) }
38763878
@@ -3882,9 +3884,10 @@ parenPattern:
38823884 { let mColonColon = rhs parseState 2
38833885 SynPat.ListCons($1, $3, rhs2 parseState 1 3, { ColonColonRange = mColonColon }) }
38843886
3885- | parenPattern COLON_COLON ends_coming_soon_or_recover
3887+ | parenPattern COLON_COLON recover
38863888 { let mColonColon = rhs parseState 2
3887- reportParseErrorAt mColonColon (FSComp.SR.parsExpectingPattern ())
3889+ if not $3 then
3890+ reportParseErrorAt mColonColon (FSComp.SR.parsExpectingPattern ())
38883891 let pat2 = SynPat.Wild(mColonColon.EndRange)
38893892 SynPat.ListCons($1, pat2, rhs2 parseState 1 2, { ColonColonRange = mColonColon }) }
38903893
0 commit comments