anchor.diff:          if seenThisTycon && allowMultiIntfInst = AllowMultiIntfInstantiations.No then state else
   
           let state =
  -            if isAppTy g ty then
  -                let tcref = tcrefOfAppTy g ty
  +            match tryTcrefOfAppTy g ty with
  +            | ValueSome tcref ->
                   let visitedTycon = Set.add tcref.Stamp visitedTycon
                   visitedTycon, visited.Add (tcref, ty), acc
  -            else
  +            | _ ->
                   state
   
           if ndeep > 100 then (errorR(Error((FSComp.SR.recursiveClassHierarchy (showType ty)), m)); (visitedTycon, visited, acc)) else
  
positive.code: 
  /// Indicates if an F# type is the type associated with an F# exception declaration
  let isExnDeclTy g ty =
      isAppTy g ty && (tcrefOfAppTy g ty).IsExceptionDecl
  
  /// Get the base type of a type, taking into account type instantiations. Return None if the
  /// type has no base type.
  let GetSuperTypeOfType g amap m ty =
  #if !NO_EXTENSIONTYPING
      let ty = (if isAppTy g ty && (tcrefOfAppTy g ty).IsProvided then stripTyEqns g ty else stripTyEqnsAndMeasureEqns g ty)
  #else
      let ty = stripTyEqnsAndMeasureEqns g ty
  #endif
  
negative.code: 
  /// Check if two types have the same nominal head type
  let HaveSameHeadType g ty1 ty2 =
      match tryTcrefOfAppTy g ty1 with
      | ValueSome tcref1 ->
          match tryTcrefOfAppTy g ty2 with
          | ValueSome tcref2 -> tyconRefEq g tcref1 tcref2
          | _ -> false
      | _ -> false
  
  /// Check if a type has a particular head type
  let HasHeadType g tcref ty2 =
      match tryTcrefOfAppTy g ty2 with
      | ValueSome tcref2 -> tyconRefEq g tcref tcref2
      | ValueNone -> false
  
  /// 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)
  let ExistsSameHeadTypeInHierarchy g amap m typeToSearchFrom typeToLookFor =
  