anchor.diff:                       |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not)
                        |> List.map Item.ExnCase
                | _ ->
  -                 let ilTyconNames = 
  -                     mty.TypesByAccessNames.Values
  -                     |> List.choose (fun (tycon:Tycon) -> if tycon.IsILTycon then Some tycon.DisplayName else None)
  -                     |> Set.ofList
  -
                    // Collect up the accessible sub-modules. We must yield them even though `item` is not a module or namespace, 
                    // otherwise we would not resolve long idents which have modules and namespaces in the middle (i.e. all long idents)
  -                 yield! 
  +                 
  +                 let moduleOrNamespaces = 
                        mty.ModulesAndNamespacesByDemangledName 
  -                     |> NameMap.range 
  -                     |> List.filter (fun x -> 
  -                           let demangledName = x.DemangledModuleOrNamespaceName
  -                           notFakeContainerModule ilTyconNames demangledName && IsInterestingModuleName demangledName)
  -                     |> List.map modref.NestedTyconRef
  -                     |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not)
  -                     |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad)
  -                     |> List.map ItemForModuleOrNamespaceRef
  +                     |> NameMap.range
  +
  +                 if not (isNil moduleOrNamespaces) then
  +                     let ilTyconNames = getFakeContainerModulesFromTycons mty.TypesByAccessNames.Values
  +                     
  +                     yield!
  +                         moduleOrNamespaces
  +                         |> List.filter (fun x -> 
  +                               let demangledName = x.DemangledModuleOrNamespaceName
  +                               notFakeContainerModule ilTyconNames demangledName && IsInterestingModuleName demangledName)
  +                         |> List.map modref.NestedTyconRef
  +                         |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not)
  +                         |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad)
  +                         |> List.map ItemForModuleOrNamespaceRef
  +
                    let tycons = 
                        mty.TypeDefinitions
                        |> List.filter (fun tcref -> not (tcref.LogicalName.Contains(",")))
  
positive.code:         | Exception _ -> []
  
  /// import.fs creates somewhat fake modules for nested members of types (so that 
  /// types never contain other types) 
  let notFakeContainerModule tyconNames nm = 
      not (Set.contains nm tyconNames)
  
  /// Check is a namespace or module contains something accessible 
  let rec private EntityRefContainsSomethingAccessible (ncenv: NameResolver) m ad (modref:ModuleOrNamespaceRef) = 
  
negative.code:     |  [] ->     
          
          // empty plid - return namespaces\modules\record types\accessible fields
  
  
         let mods = 
             let moduleOrNamespaceRefs =
                 nenv.ModulesAndNamespaces fullyQualified
                 |> NameMultiMap.range 
  
             if isNil moduleOrNamespaceRefs then [] else
  
             let ilTyconNames = getFakeContainerModulesFromTyconRefs (nenv.TyconsByAccessNames(fullyQualified).Values)
  
             moduleOrNamespaceRefs
             |> List.filter (fun x -> 
                  let demangledName = x.DemangledModuleOrNamespaceName
                  IsInterestingModuleName demangledName && notFakeContainerModule ilTyconNames demangledName)
             |> List.filter (EntityRefContainsSomethingAccessible ncenv m ad)
             |> List.filter (IsTyconUnseen ad g ncenv.amap m >> not)
             |> List.map ItemForModuleOrNamespaceRef
  