Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit27a2b63

Browse files
committed
do not abort overload resolution if parameter list contains errors
1 parent2851370 commit27a2b63

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/fsharp/tc.fs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3018,7 +3018,15 @@ let GetMethodArgs arg =
30183018
| SynExpr.Const (SynConst.Unit,_) -> []
30193019
| SynExprParen(SynExpr.Tuple (args,_,_),_,_,_) | SynExpr.Tuple (args,_,_) -> args
30203020
| SynExprParen(arg,_,_,_) | arg -> [arg]
3021-
let unnamedCallerArgs,namedCallerArgs = List.takeUntil IsNamedArg args
3021+
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
30223030
let namedCallerArgs =
30233031
namedCallerArgs |> List.choose (fun e ->
30243032
if not (IsNamedArg e) then

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp