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

Commite57e82a

Browse files
committed
cleanup
1 parent9a9329e commite57e82a

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

‎src/fsharp/ConstraintSolver.fs‎

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p
12321232
leterr=
12331233
match opNamewith
12341234
|"?>="|"?>"|"?<="|"?<"|"?="|"?<>"
1235-
|">=?"|">?"|"<=?"|"<?"|"=?"|"<>?"
1235+
|">=?"|">?"|"<=?"|"<?"|"=?"|"<>?"
12361236
|"?>=?"|"?>?"|"?<=?"|"?<?"|"?=?"|"?<>?"->
12371237
if tys.Length=1then FSComp.SR.csTypeDoesNotSupportOperatorNullable(tyString,opName)
12381238
else FSComp.SR.csTypesDoNotSupportOperatorNullable(tyString,opName)
@@ -1264,8 +1264,7 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p
12641264
SolveTypEqualsTypKeepAbbrevs csenv ndeep m2 trace rty rty2++(fun()->
12651265
ResultD(TTraitSolvedRecdProp(rfinfo, isSetProp)))
12661266
| None, Some(calledMeth:CalledMeth<_>)->
1267-
// OK, the constraint is solved.
1268-
1267+
// OK, the constraint is solved.
12691268
letminfo= calledMeth.Method
12701269

12711270
errors++(fun()->
@@ -1280,13 +1279,12 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p
12801279
ResultD(TTraitSolved(minfo,calledMeth.CalledTyArgs))))
12811280

12821281
|_->
1283-
1284-
letsupport= GetSupportOfMemberConstraint csenv traitInfo
1285-
letfrees= GetFreeTyparsOfMemberConstraint csenv traitInfo
1282+
letsupport= GetSupportOfMemberConstraint csenv traitInfo
1283+
letfrees= GetFreeTyparsOfMemberConstraint csenv traitInfo
12861284

12871285
// If there's nothing left to learn then raise the errors
12881286
(if(permitWeakResolution&& isNil support)|| isNil freesthen errors
1289-
// Otherwise re-record the trait waiting for canonicalization
1287+
// Otherwise re-record the trait waiting for canonicalization
12901288
else AddMemberConstraint csenv ndeep m2 trace traitInfo support frees)++(fun()->
12911289
match errorswith
12921290
| ErrorResult(_,UnresolvedOverloading_)whennot ignoreUnresolvedOverload&&(not(nm="op_Explicit"|| nm="op_Implicit"))-> ErrorD LocallyAbortOperationThatFailsToResolveOverload
@@ -1298,8 +1296,7 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload p
12981296

12991297
/// Record the solution to a member constraint in the mutable reference cell attached to
13001298
/// each member constraint.
1301-
andRecordMemberConstraintSolution css m trace traitInfo res=
1302-
1299+
andRecordMemberConstraintSolution css m trace traitInfo res=
13031300
match reswith
13041301
| TTraitUnsolved->
13051302
ResultDfalse
@@ -1359,8 +1356,7 @@ and MemberConstraintSolutionOfMethInfo css m minfo minst =
13591356

13601357
#endif
13611358

1362-
andMemberConstraintSolutionOfRecdFieldInfo rfinfo isSet=
1363-
1359+
andMemberConstraintSolutionOfRecdFieldInfo rfinfo isSet=
13641360
FSRecdFieldSln(rfinfo.TypeInst,rfinfo.RecdFieldRef,isSet)
13651361

13661362
/// Write into the reference cell stored in the TAST and add to the undo trace if necessary
@@ -1435,8 +1431,7 @@ and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep per
14351431
SolveMemberConstraint csenvtrue permitWeakResolution(ndeep+1) m2 trace traitInfo)
14361432

14371433
andCanonicalizeRelevantMemberConstraints(csenv:ConstraintSolverEnv)ndeep trace tps=
1438-
SolveRelevantMemberConstraints csenv ndeeptrue trace tps
1439-
1434+
SolveRelevantMemberConstraints csenv ndeeptrue trace tps
14401435

14411436
andAddMemberConstraint(csenv:ConstraintSolverEnv)ndeep m2 trace traitInfo support frees=
14421437
letg= csenv.g
@@ -1454,7 +1449,7 @@ and AddMemberConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace traitInfo sup
14541449
// check the constraint is not already listed for this type variable
14551450
ifnot(cxs|> List.exists(fun(traitInfo2,_)-> traitsAEquiv g aenv traitInfo traitInfo2))then
14561451
trace.Exec(fun()-> csenv.SolverState.ExtraCxs.Add(tpn,(traitInfo,m2)))(fun()-> csenv.SolverState.ExtraCxs.Remove tpn)
1457-
);
1452+
)
14581453

14591454
// Associate the constraint with each type variable in the support, so if the type variable
14601455
// gets generalized then this constraint is attached at the binding site.
@@ -1469,7 +1464,6 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint =
14691464
letdenv= csenv.DisplayEnv
14701465
letm= csenv.m
14711466

1472-
14731467
// Type variable sets may not have two trait constraints with the same name, nor
14741468
// be constrained by different instantiations of the same interface type.
14751469
//
@@ -1494,16 +1488,14 @@ and AddConstraint (csenv:ConstraintSolverEnv) ndeep m2 trace tp newConstraint =
14941488
CompleteD))
14951489

14961490
|(TyparConstraint.CoercesTo(ty1,_),
1497-
TyparConstraint.CoercesTo(ty2,_))->
1498-
1499-
1491+
TyparConstraint.CoercesTo(ty2,_))->
15001492
// Record at most one subtype constraint for each head type.
15011493
// That is, we forbid constraints by both I<string> and I<int>.
15021494
// This works because the types on the r.h.s. of subtype
15031495
// constraints are head-types and so any further inferences are equational.
15041496
letcollect ty=
15051497
letres= ref[]
1506-
IterateEntireHierarchyOfType(fun x-> res:= x::!res) g amap m AllowMultiIntfInstantiations.No ty;
1498+
IterateEntireHierarchyOfType(fun x-> res:= x::!res) g amap m AllowMultiIntfInstantiations.No ty
15071499
List.rev!res
15081500
letparents1= collect ty1
15091501
letparents2= collect ty2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp