Example #1
0
 /// <summary>
 /// Gets all candidate extension methods.
 /// Note: this includes candidates that are not eligible due to an inapplicable
 /// this argument.
 /// The candidates will only be specialized if the type arguments were provided explicitly.
 /// </summary>
 /// <remarks>
 /// The results are stored in nested lists because they are grouped by using scope.
 /// That is, for "using SomeExtensions; namespace X { using MoreExtensions; ... }",
 /// the return value will be
 /// new List {
 ///    new List { all extensions from MoreExtensions },
 ///    new List { all extensions from SomeExtensions }
 /// }
 /// </remarks>
 public IEnumerable <IEnumerable <IMethod> > GetExtensionMethods()
 {
     if (resolver != null)
     {
         Debug.Assert(extensionMethods == null);
         try {
             extensionMethods = resolver.GetExtensionMethods(methodName, typeArguments);
         } finally {
             resolver = null;
         }
     }
     return(extensionMethods ?? Enumerable.Empty <IEnumerable <IMethod> >());
 }