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

Commitf8103bb

Browse files
libozKevinRansom
authored andcommitted
More robust check for isSequential (dotnet#2189)
* more robust check for isSequential* using type inference for the signature* using even more type inferencing
1 parenta0d383f commitf8103bb

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎src/fsharp/ConstraintSolver.fs‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,7 +1992,7 @@ and ArgsEquivInsideUndo (csenv:ConstraintSolverEnv) isConstraint calledArg (Call
19921992
ifnot(typeEquiv csenv.g calledArgTy callerArgTy)then ErrorD(Error(FSComp.SR.csArgumentTypesDoNotMatch(),m))else
19931993
CompleteD
19941994

1995-
andReportNoCandidatesError(csenv:ConstraintSolverEnv)(nUnnamedCallerArgs,nNamedCallerArgs)methodName ad(calledMethGroup:CalledMeth<_>list)=
1995+
andReportNoCandidatesError(csenv:ConstraintSolverEnv)(nUnnamedCallerArgs,nNamedCallerArgs)methodName ad(calledMethGroup:CalledMeth<_>list)isSequential=
19961996

19971997
letamap= csenv.amap
19981998
letm= csenv.m
@@ -2054,7 +2054,7 @@ and ReportNoCandidatesError (csenv:ConstraintSolverEnv) (nUnnamedCallerArgs,nNam
20542054
cmeth.ArgSets
20552055
|> List.exists(fun argSet->
20562056
argSet.UnnamedCallerArgs
2057-
|> List.exists(fun c-> c.Expr.ToString().EndsWith"Sequential"))
2057+
|> List.exists(fun c->isSequentialc.Expr))
20582058

20592059
if couldBeNameArgsthen
20602060
Error(FSComp.SR.csCtorSignatureMismatchArityProp(methodName, nReqd, nActual, signature), m)
@@ -2106,6 +2106,13 @@ and ReportNoCandidatesError (csenv:ConstraintSolverEnv) (nUnnamedCallerArgs,nNam
21062106
Error(msg,m)
21072107
|> ErrorD
21082108

2109+
andReportNoCandidatesErrorExpr csenv callerArgCounts methodName ad calledMethGroup=
2110+
letisSequential e=match ewith| Expr.Sequential(_,_,_,_,_)->true|_->false
2111+
ReportNoCandidatesError csenv callerArgCounts methodName ad calledMethGroup isSequential
2112+
2113+
andReportNoCandidatesErrorSynExpr csenv callerArgCounts methodName ad calledMethGroup=
2114+
letisSequential e=match ewith| SynExpr.Sequential(_,_,_,_,_)->true|_->false
2115+
ReportNoCandidatesError csenv callerArgCounts methodName ad calledMethGroup isSequential
21092116

21102117
// Resolve the overloading of a method
21112118
// This is used after analyzing the types of arguments
@@ -2138,7 +2145,7 @@ and ResolveOverloading
21382145
None, ErrorD(Error(FSComp.SR.csMethodNotFound(methodName),m)), NoTrace
21392146

21402147
|_,[]whennot isOpConversion->
2141-
None,ReportNoCandidatesError csenv callerArgCounts methodName ad calledMethGroup, NoTrace
2148+
None,ReportNoCandidatesErrorExpr csenv callerArgCounts methodName ad calledMethGroup, NoTrace
21422149

21432150
|_,_->
21442151

@@ -2447,7 +2454,7 @@ let UnifyUniqueOverloading
24472454
|[],_->
24482455
ErrorD(Error(FSComp.SR.csMethodNotFound(methodName),m))
24492456
|_,[]->
2450-
ReportNoCandidatesError csenv callerArgCounts methodName ad calledMethGroup
2457+
ReportNoCandidatesErrorSynExpr csenv callerArgCounts methodName ad calledMethGroup
24512458
++(fun()-> ResultDfalse)
24522459
|_->
24532460
ResultDfalse

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp