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

Commite5323b5

Browse files
forkiKevinRansom
authored andcommitted
Remove a setify + isSingleton combo (#4980)
* remove a setify* Remove intermediate collection
1 parent061c0e5 commite5323b5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

‎src/fsharp/TypeChecker.fs‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10012,11 +10012,13 @@ and TcMethodArg cenv env (lambdaPropagationInfo, tpenv) (lambdaPropagationInfo
1001210012
// The loop variable callerLambdaTyOpt becomes None if something failed.
1001310013
let rec loop callerLambdaTy lambdaVarNum =
1001410014
if lambdaVarNum < numLambdaVars then
10015-
let col = [ for row in prefixOfLambdaArgsForEachOverload -> row.[lambdaVarNum] ]
10016-
// Check if all the rows give the same argument type
10017-
if col |> ListSet.setify (typeEquiv cenv.g) |> isSingleton then
10018-
let calledLambdaArgTy = col.[0]
10019-
// Force the caller to be a function type.
10015+
let calledLambdaArgTy = prefixOfLambdaArgsForEachOverload.[0].[lambdaVarNum]
10016+
let allRowsGiveSameArgumentType =
10017+
prefixOfLambdaArgsForEachOverload
10018+
|> Array.forall (fun row -> typeEquiv cenv.g calledLambdaArgTy row.[lambdaVarNum])
10019+
10020+
if allRowsGiveSameArgumentType then
10021+
// Force the caller to be a function type.
1002010022
match UnifyFunctionTypeUndoIfFailed cenv env.DisplayEnv mArg callerLambdaTy with
1002110023
| Some (callerLambdaDomainTy, callerLambdaRangeTy) ->
1002210024
if AddCxTypeEqualsTypeUndoIfFailed env.DisplayEnv cenv.css mArg calledLambdaArgTy callerLambdaDomainTy then

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp