Enable await expressions to work with dynamic binder
[mono.git] / mcs / mcs / class.cs
index 95753aa88d6e9c8f26ba8e62459bc0fff0f6dbf7..c9dd88543849db374d6986df6c4a343541ed7461 100644 (file)
@@ -99,7 +99,7 @@ namespace Mono.CSharp
                                return tc.GetSignatureForError ();
                        }
 
-                       public IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
+                       public ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)
                        {
                                return null;
                        }
@@ -738,7 +738,7 @@ namespace Mono.CSharp
                                        ExpressionStatement s = fi.ResolveStatement (ec);
                                        if (s == null) {
                                                s = EmptyExpressionStatement.Instance;
-                                       } else if (fi.IsComplexInitializer) {
+                                       } else if (!fi.IsSideEffectFree) {
                                                has_complex_initializer |= true;
                                        }
 
@@ -2437,18 +2437,19 @@ namespace Mono.CSharp
                        }
                }
 
-               public override IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
+               public override ExtensionMethodCandidates LookupExtensionMethod (TypeSpec extensionType, string name, int arity)
                {
                        DeclSpace top_level = Parent;
                        if (top_level != null) {
-                               var candidates = NamespaceEntry.NS.LookupExtensionMethod (this, extensionType, name, arity);
-                               if (candidates != null) {
-                                       scope = NamespaceEntry;
-                                       return candidates;
+                               var methods = NamespaceEntry.NS.LookupExtensionMethod (this, extensionType, name, arity);
+                               if (methods != null) {
+                                       return new ExtensionMethodCandidates (methods, NamespaceEntry, NamespaceEntry.NS) {
+                                               HasUninspectedMembers = true
+                                       };
                                }
                        }
 
-                       return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity, ref scope);
+                       return NamespaceEntry.LookupExtensionMethod (extensionType, name, arity);
                }
 
                protected override TypeAttributes TypeAttr {