You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Compiler/Checking/NameResolution.fs
+28-7Lines changed: 28 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -727,7 +727,7 @@ let SelectMethInfosFromExtMembers (infoReader: InfoReader) optFilter apparentTy
727
727
]
728
728
729
729
/// Query the available extension methods of a type (including extension methods for inherited types)
730
-
letExtensionMethInfosOfTypeInScope(collectionSettings:ResultCollectionSettings)(infoReader:InfoReader)(nenv:NameResolutionEnv)optFilter isInstanceFilter m ty =
730
+
letExtensionMethInfosOfTypeInScope(collectionSettings:ResultCollectionSettings)(infoReader:InfoReader)(nenv:NameResolutionEnv)ad optFilter isInstanceFilter m ty =
731
731
letextMemsDangling= SelectMethInfosFromExtMembers infoReader optFilter ty m nenv.eUnindexedExtensionMembers
732
732
if collectionSettings = ResultCollectionSettings.AtMostOneResult &¬(isNil extMemsDangling)then
733
733
extMemsDangling
@@ -743,6 +743,27 @@ let ExtensionMethInfosOfTypeInScope (collectionSettings: ResultCollectionSetting
743
743
|_->[])
744
744
extMemsDangling @ extMemsFromHierarchy
745
745
|> List.filter (fun minfo ->
746
+
letg= infoReader.g
747
+
letamap= infoReader.amap
748
+
749
+
letisAccesible= AccessibilityLogic.IsMethInfoAccessible amap m ad minfo
750
+
751
+
letisThisArgEq=
752
+
match minfo.GetObjArgTypes(amap, m,[])with
753
+
| thisTy ::_->
754
+
lett1= stripTyEqnsWrtErasure EraseNone g thisTy
755
+
lett2= stripTyEqnsWrtErasure EraseNone g ty
756
+
757
+
match t1, t2 with
758
+
| TType_app (tc1,_,_), TType_app (tc2,_,_)->
759
+
tyconRefEq g tc1 tc2
760
+
|_->
761
+
false
762
+
|_->
763
+
false
764
+
765
+
isAccesible &&
766
+
isThisArgEq &&
746
767
match isInstanceFilter with
747
768
| LookupIsInstance.Ambivalent ->true
748
769
| LookupIsInstance.Yes -> minfo.IsInstance
@@ -754,7 +775,7 @@ let AllMethInfosOfTypeInScope collectionSettings infoReader nenv optFilter ad fi
754
775
if collectionSettings = ResultCollectionSettings.AtMostOneResult &¬(isNil intrinsic)then
755
776
intrinsic
756
777
else
757
-
intrinsic @ ExtensionMethInfosOfTypeInScope collectionSettings infoReader nenv optFilter LookupIsInstance.Ambivalent m ty
778
+
intrinsic @ ExtensionMethInfosOfTypeInScope collectionSettings infoReader nenv ad optFilter LookupIsInstance.Ambivalent m ty
0 commit comments