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

Commitd9348d6

Browse files
committed
More tryFullDestAppTy
1 parent2bb2382 commitd9348d6

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎src/fsharp/ConstraintSolver.fs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,23 +1713,21 @@ and SolveTypSupportsEquality (csenv:ConstraintSolverEnv) ndeep m2 trace ty =
17131713
ErrorD(ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportEquality2(NicePrint.minimalStringOfType denv ty),m,m2))
17141714
|_->
17151715
// The type is equatable because it has Object.Equals(...)
1716-
if isAppTy g tythen
1717-
lettcref,tinst= destAppTy g ty
1718-
1716+
match tryFullDestAppTy g tywith
1717+
| Some(tcref,tinst)->
17191718
// Give a good error for structural types excluded from the equality relation because of their fields
1720-
if(AugmentWithHashCompare.TyconIsCandidateForAugmentationWithEquals g tcref.Deref&&
1721-
Option.isNone tcref.GeneratedHashAndEqualsWithComparerValues)then
1722-
1719+
if AugmentWithHashCompare.TyconIsCandidateForAugmentationWithEquals g tcref.Deref&&
1720+
Option.isNone tcref.GeneratedHashAndEqualsWithComparerValues
1721+
then
17231722
ErrorD(ConstraintSolverError(FSComp.SR.csTypeDoesNotSupportEquality3(NicePrint.minimalStringOfType denv ty),m,m2))
1724-
17251723
else
17261724
// Check the (possibly inferred) structural dependencies
17271725
(tinst, tcref.TyparsNoRange)||> Iterate2D(fun ty tp->
17281726
if tp.EqualityConditionalOnthen
17291727
SolveTypSupportsEquality(csenv:ConstraintSolverEnv) ndeep m2 trace ty
17301728
else
17311729
CompleteD)
1732-
else
1730+
| None->
17331731
CompleteD
17341732

17351733
andSolveTypIsEnum(csenv:ConstraintSolverEnv)ndeep m2 trace ty underlying=

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp