anchor.diff:              success(resInfo,Item.Value (mkNestedValRef modref vspec),rest)
           | _ ->
           // Something in a type? e.g. a literal field 
  -        let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref)
  +        let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref)
           let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref))
           let tyconSearch = 
               match lid with 
  
positive.code: #endif
  
  /// Lookup a type name in an entity.
  let LookupTypeNameInEntityMaybeHaveArity (amap, m, nm, staticResInfo:TypeNameResolutionStaticArgsInfo, modref: ModuleOrNamespaceRef) = 
      let mtyp = modref.ModuleOrNamespaceType    
      let tcrefs = 
          match staticResInfo with 
  
negative.code:         CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m)
  #endif
          let m = unionRanges m id.idRange
          let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, typeNameResInfo.StaticArgsInfo, tcref)
          let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref))
          let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, m) 
          match tcrefs with 
  