@@ -3019,18 +3019,15 @@ let GetMethodArgs arg =
30193019 | SynExprParen(SynExpr.Tuple (args,_,_),_,_,_) | SynExpr.Tuple (args,_,_) -> args
30203020 | SynExprParen(arg,_,_,_) | arg -> [arg]
30213021 let unnamedCallerArgs,namedCallerArgs =
3022- args
3023- |> List.filter (fun arg ->
3024- match arg with
3025- // drop errors to avoid confusing error messages in cases like foo(a = 1,)
3026- // here subsequent step will abort overload resolution complaining that name arguments should appear last
3027- | SynExpr.ArbitraryAfterError _ -> false
3028- | _ -> true)
3029- |> List.takeUntil IsNamedArg
3022+ args |> List.takeUntil IsNamedArg
30303023 let namedCallerArgs =
30313024 namedCallerArgs |> List.choose (fun e ->
3032- if not (IsNamedArg e) then
3033- error(Error(FSComp.SR.tcNameArgumentsMustAppearLast(), e.Range))
3025+ if not (IsNamedArg e) then
3026+ // ignore errors to avoid confusing error messages in cases like foo(a = 1,)
3027+ // do not abort overload resolution in case if named arguments are mixed with errors
3028+ match e with
3029+ | SynExpr.ArbitraryAfterError _ -> ()
3030+ | _ -> error(Error(FSComp.SR.tcNameArgumentsMustAppearLast(), e.Range))
30343031 TryGetNamedArg e)
30353032 unnamedCallerArgs, namedCallerArgs
30363033