[mcs] Use same result bucket for extension method lookup in all types of using expression
[mono.git] / mcs / mcs / namespace.cs
index 0a35cc4c61e7fd8212c58c7a81277026a4193cd2..f5ca0a818a4480e5080a67945f414dca21fd4a2e 100644 (file)
@@ -951,22 +951,18 @@ namespace Mono.CSharp {
                                                candidates.AddRange (a);
                                }
 
-                               if (candidates != null)
-                                       return new ExtensionMethodCandidates (invocationContext, candidates, this, position);
-                       }
+                               if (types_using_table != null) {
+                                       foreach (var t in types_using_table) {
 
-                       // LAMESPEC: TODO no spec about priority over normal extension methods yet
-                       if (types_using_table != null) {
-                               foreach (var t in types_using_table) {
-
-                                       var res = t.MemberCache.FindExtensionMethods (invocationContext, name, arity);
-                                       if (res == null)
-                                               continue;
+                                               var res = t.MemberCache.FindExtensionMethods (invocationContext, name, arity);
+                                               if (res == null)
+                                                       continue;
 
-                                       if (candidates == null)
-                                               candidates = res;
-                                       else
-                                               candidates.AddRange (res);
+                                               if (candidates == null)
+                                                       candidates = res;
+                                               else
+                                                       candidates.AddRange (res);
+                                       }
                                }
 
                                if (candidates != null)