2007-01-03 Chris Toshok <toshok@ximian.com>
[mono.git] / mcs / mcs / parameter.cs
index ef0d3f7a20f98c0553555f6ec95bd67aa86a586f..80fc9753ca47e6b8da596f07efaf3539a5122d69 100644 (file)
@@ -348,8 +348,8 @@ namespace Mono.CSharp {
 
                public void ResolveVariable (ToplevelBlock toplevel, int idx)
                {
-                       if (toplevel.AnonymousMethodHost != null)
-                               var = toplevel.AnonymousMethodHost.GetCapturedParameter (this);
+                       if (toplevel.RootScope != null)
+                               var = toplevel.RootScope.GetCapturedParameter (this);
                        if (var == null)
                                var = new ParameterVariable (this, idx);
                }
@@ -794,7 +794,11 @@ namespace Mono.CSharp {
                                if (count == 0)
                                        return false;
 
-                               return FixedParameters [count - 1] is ParamsParameter;
+                               for (int i = count; i != 0; --i) {
+                                       if ((FixedParameters [i - 1].ModFlags & Parameter.Modifier.PARAMS) != 0)
+                                               return true;
+                               }
+                               return false;
                        }
                }