anchor.diff:             |> List.filter (fun tycon -> tycon.IsRecordTycon)
              |> List.filter (fun tycon -> not (IsTyconUnseen ad g ncenv.amap m (modref.NestedTyconRef tycon)))
   
  -       let ilTyconNames = 
  -           mty.TypesByAccessNames.Values
  -           |> List.choose (fun (tycon:Tycon) -> if tycon.IsILTycon then Some tycon.DisplayName else None)
  -           |> Set.ofList
  +
  +       let accessibleSubModules =
  +           let moduleOrNamespaces =
  +               mty.ModulesAndNamespacesByDemangledName 
  +               |> NameMap.range
  +
  +           if isNil moduleOrNamespaces then [] else
  +
  +           let ilTyconNames = getFakeContainerModulesFromTycons mty.TypesByAccessNames.Values 
       
  -        // Collect up the accessible sub-modules 
  -       (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)
  +           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
  +       
  +       accessibleSubModules
   
          // Collect all accessible record types
          @ (tycons |> List.map (modref.NestedTyconRef >> ItemOfTyconRef ncenv m) )
  
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
  