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
// Do not visit the same type twice. Could only be doing this if we've seen this tycon
163
172
if seenThisTycon && List.exists (typeEquiv g ty)(visited.Find (tcrefOfAppTy g ty))then state else
@@ -166,11 +175,11 @@ let private FoldHierarchyOfTypeAux followInterfaces allowMultiIntfInst skipUnref
166
175
if seenThisTycon && allowMultiIntfInst = AllowMultiIntfInstantiations.No then state else
167
176
168
177
letstate=
169
-
if isAppTy g ty then
170
-
lettcref= tcrefOfAppTy g ty
178
+
match tryTcrefOfAppTy g ty with
179
+
| ValueSome tcref ->
171
180
letvisitedTycon= Set.add tcref.Stamp visitedTycon
172
181
visitedTycon, visited.Add (tcref, ty), acc
173
-
else
182
+
|_->
174
183
state
175
184
176
185
if ndeep >100then(errorR(Error((FSComp.SR.recursiveClassHierarchy (showType ty)), m));(visitedTycon, visited, acc))else
@@ -257,14 +266,18 @@ let AllInterfacesOfType g amap m allowMultiIntfInst ty =
257
266
258
267
/// Check if two types have the same nominal head type
259
268
letHaveSameHeadType g ty1 ty2 =
260
-
isAppTy g ty1 && isAppTy g ty2 &&
261
-
tyconRefEq g (tcrefOfAppTy g ty1)(tcrefOfAppTy g ty2)
269
+
match tryTcrefOfAppTy g ty1 with
270
+
| ValueSome tcref1 ->
271
+
match tryTcrefOfAppTy g ty2 with
272
+
| ValueSome tcref2 -> tyconRefEq g tcref1 tcref2
273
+
|_->false
274
+
|_->false
262
275
263
276
/// Check if a type has a particular head type
264
277
letHasHeadType g tcref ty2 =
265
-
isAppTy g ty2 &&
266
-
tyconRefEq g tcref (tcrefOfAppTy g ty2)
267
-
278
+
match tryTcrefOfAppTy g ty2 with
279
+
| ValueSome tcref2 -> tyconRefEq g tcref tcref2
280
+
| ValueNone ->false
268
281
269
282
/// Check if a type exists somewhere in the hierarchy which has the same head type as the given type (note, the given type need not have a head type at all)
270
283
letExistsSameHeadTypeInHierarchy g amap m typeToSearchFrom typeToLookFor =
0 commit comments