@@ -268,7 +268,9 @@ type (* internal *) Method =
268268type MethodOverloads ( name : string , unsortedMethods : Method [] ) =
269269// BUG 413009 : [ParameterInfo] takes about 3 seconds to move from one overload parameter to another
270270// cache allows to avoid recomputing parameterinfo for the same item
271+ #if FX_ ATLEAST_ 40
271272static let methodOverloadsCache = System.Runtime.CompilerServices.ConditionalWeakTable()
273+ #endif
272274
273275let methods =
274276 unsortedMethods
@@ -285,9 +287,11 @@ type MethodOverloads( name: string, unsortedMethods: Method[] ) =
285287if isNil itemsthen new MethodOverloads( " " , [| |]) else
286288let name = DisplayNameOfItem g items.Head
287289let getOverloadsForItem item =
290+ #if FX_ ATLEAST_ 40
288291match methodOverloadsCache.TryGetValue itemwith
289292| true , overloads-> overloads
290293| false , _ ->
294+ #endif
291295let items =
292296match itemwith
293297| Item.MethodGroup( nm, minfos) -> List.map( fun minfo -> Item.MethodGroup( nm,[ minfo])) minfos
@@ -326,7 +330,9 @@ type MethodOverloads( name: string, unsortedMethods: Method[] ) =
326330 Parameters= Array.ofList( Params.ParamsOfItem infoReader m denv item)
327331 IsStaticArguments= match itemwith | Item.Types_ -> true | _ -> false
328332})
333+ #if FX_ ATLEAST_ 40
329334 methodOverloadsCache.Add( item, methods)
335+ #endif
330336 methods
331337let methods = [| for itemin itemsdo yield ! getOverloadsForItem item|]
332338