We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent2851370 commit27a2b63Copy full SHA for 27a2b63
src/fsharp/tc.fs
@@ -3018,7 +3018,15 @@ let GetMethodArgs arg =
3018
| SynExpr.Const (SynConst.Unit,_) -> []
3019
| SynExprParen(SynExpr.Tuple (args,_,_),_,_,_) | SynExpr.Tuple (args,_,_) -> args
3020
| SynExprParen(arg,_,_,_) | arg -> [arg]
3021
- let unnamedCallerArgs,namedCallerArgs = List.takeUntil IsNamedArg args
+ 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
3030
let namedCallerArgs =
3031
namedCallerArgs |> List.choose (fun e ->
3032
if not (IsNamedArg e) then