manually synchronized with 56802
authorMarek Safar <marek.safar@gmail.com>
Wed, 15 Mar 2006 20:17:25 +0000 (20:17 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 15 Mar 2006 20:17:25 +0000 (20:17 -0000)
svn path=/trunk/mcs/; revision=58039

mcs/errors/Makefile
mcs/errors/known-issues-gmcs
mcs/gmcs/anonymous.cs
mcs/gmcs/assign.cs
mcs/gmcs/constant.cs
mcs/gmcs/convert.cs
mcs/gmcs/delegate.cs
mcs/gmcs/ecore.cs
mcs/gmcs/expression.cs
mcs/gmcs/generic.cs

index faf074e9ffc388cef0a1c7ebaeb124da8801f750..151f7521dd2257f8b2779853756996e5a0759801 100644 (file)
@@ -57,7 +57,7 @@ test-everything:
 
 ifeq (net_2_0, $(PROFILE))
 COMPILER_NAME = gmcs
-COMPILER = $(topdir)/gmcs/gmcs.exe
+COMPILER = $(topdir)/class/lib/$(PROFILE)/gmcs.exe
 TEST_PATTERN = '*cs*.cs'
 else
 COMPILER_NAME = mcs
@@ -68,7 +68,7 @@ endif
 run-mcs-tests: $(TEST_SUPPORT_FILES)
 
 run-mcs-tests:
-       MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe negative $(TEST_PATTERN) $(COMPILER) known-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
+       MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe negative 0 $(COMPILER) known-issues-$(COMPILER_NAME) $(COMPILER_NAME).log
 
 clean-local:
        rm -f *.exe *.dll *.log *.mdb dummy.xml *.junk
index b508144019481c25ca91261825fdd161ebe9cddf..047bac75a3cdfb7d3ceb007850acd444ee7b0d77 100644 (file)
@@ -15,7 +15,6 @@ cs0102-16.cs
 cs0111-16.cs NO ERROR
 cs0111-17.cs
 cs0144-3.cs NO ERROR
-cs0214-8.cs
 cs0221-5.cs NO ERROR
 cs0229-2.cs
 cs0229.cs NO ERROR
index c5c561875d8038fb694e905887a5bbe936e5bdfc..024aafa614c448c116cd7710e1e0195fda0326b2 100644 (file)
@@ -316,7 +316,7 @@ namespace Mono.CSharp {
                        // needed for the anonymous method.  We create the method here.
                        //
 
-                       MethodGroupExpr invoke_mg = Delegate.GetInvokeMethod (ec, delegate_type, loc);
+                       MethodGroupExpr invoke_mg = Delegate.GetInvokeMethod (ec.ContainerType, delegate_type, loc);
                        invoke_mb = (MethodInfo) invoke_mg.Methods [0];
                        ParameterData invoke_pd = TypeManager.GetParameterData (invoke_mb);
 
@@ -352,7 +352,9 @@ namespace Mono.CSharp {
                        // First, parameter types of `delegate_type' must be compatible
                        // with the anonymous method.
                        //
-                       Parameters.Resolve (ec);
+                       if (!Parameters.Resolve (ec))
+                               return null;
+
                        amp = Parameters;
                        
                        if (amp.Count != invoke_pd.Count){
index fec925732878843ee8836961343f3a5faa9695b8..618635a473beed72d274acae4846f42ce09ca224 100644 (file)
@@ -456,7 +456,7 @@ namespace Mono.CSharp {
                                        // 2. and the original right side is implicitly convertible to
                                        // the type of target
                                        //
-                                       if (Convert.ImplicitStandardConversionExists (ec, a.original_source, target_type))
+                                       if (Convert.ImplicitStandardConversionExists (a.original_source, target_type))
                                                return this;
 
                                        //
index 76c2c5667a8574a363f163ea62e0f84844823968..8424e41d8d7ea75a2041df38c5a23aef4af6059b 100644 (file)
@@ -147,7 +147,7 @@ namespace Mono.CSharp {
                        if (type == TypeManager.object_type)
                                return this;
 
-                       if (!Convert.ImplicitStandardConversionExists (Convert.ConstantEC, this, type)){
+                       if (!Convert.ImplicitStandardConversionExists (this, type)){
                                Error_ValueCannotBeConverted (loc, type, false);
                                return null;
                        }
index 1c9ca5531b21e2bf321a8a15572814c02e51db8b..328bf324ce46efca9cab7ca228942b19aadba2fe 100644 (file)
@@ -57,7 +57,7 @@ namespace Mono.CSharp {
                        return false;
                }
 
-               static Type TypeParam_EffectiveBaseType (EmitContext ec, GenericConstraints gc)
+               static Type TypeParam_EffectiveBaseType (GenericConstraints gc)
                {
                        ArrayList list = new ArrayList ();
                        list.Add (gc.EffectiveBaseClass);
@@ -67,12 +67,12 @@ namespace Mono.CSharp {
 
                                GenericConstraints new_gc = TypeManager.GetTypeParameterConstraints (t);
                                if (new_gc != null)
-                                       list.Add (TypeParam_EffectiveBaseType (ec, new_gc));
+                                       list.Add (TypeParam_EffectiveBaseType (new_gc));
                        }
-                       return FindMostEncompassedType (ec, list);
+                       return FindMostEncompassedType (list);
                }
 
-               static Expression ImplicitTypeParameterConversion (EmitContext ec, Expression expr,
+               static Expression ImplicitTypeParameterConversion (Expression expr,
                                                                   Type target_type)
                {
                        Type expr_type = expr.Type;
@@ -87,7 +87,7 @@ namespace Mono.CSharp {
                        }
 
                        // We're converting from a type parameter which is known to be a reference type.
-                       Type base_type = TypeParam_EffectiveBaseType (ec, gc);
+                       Type base_type = TypeParam_EffectiveBaseType (gc);
 
                        if (TypeManager.IsSubclassOf (base_type, target_type))
                                return new ClassCast (expr, target_type);
@@ -117,7 +117,7 @@ namespace Mono.CSharp {
                }
 
                static EmptyExpression MyEmptyExpr;
-               static public Expression ImplicitReferenceConversion (EmitContext ec, Expression expr, Type target_type)
+               static public Expression ImplicitReferenceConversion (Expression expr, Type target_type)
                {
                        Type expr_type = expr.Type;
 
@@ -131,7 +131,7 @@ namespace Mono.CSharp {
                                return null;
 
                        if (expr_type.IsGenericParameter)
-                               return ImplicitTypeParameterConversion (ec, expr, target_type);
+                               return ImplicitTypeParameterConversion (expr, target_type);
                                
                        //
                        // notice that it is possible to write "ValueType v = 1", the ValueType here
@@ -233,7 +233,7 @@ namespace Mono.CSharp {
                                        Type target_element_type = TypeManager.GetElementType (target_type);
 
                                        if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
-                                               if (ImplicitStandardConversionExists (ConstantEC, MyEmptyExpr,
+                                               if (ImplicitStandardConversionExists (MyEmptyExpr,
                                                                                      target_element_type))
                                                        return new EmptyCast (expr, target_type);
                                }
@@ -269,7 +269,7 @@ namespace Mono.CSharp {
                // Tests whether an implicit reference conversion exists between expr_type
                // and target_type
                //
-               public static bool ImplicitReferenceConversionExists (EmitContext ec, Expression expr, Type target_type)
+               public static bool ImplicitReferenceConversionExists (Expression expr, Type target_type)
                {
                        if (target_type.IsValueType)
                                return false;
@@ -277,7 +277,7 @@ namespace Mono.CSharp {
                        Type expr_type = expr.Type;
 
                        if (expr_type.IsGenericParameter)
-                               return ImplicitTypeParameterConversion (ec, expr, target_type) != null;
+                               return ImplicitTypeParameterConversion (expr, target_type) != null;
 
                        //
                        // This is the boxed case.
@@ -329,7 +329,7 @@ namespace Mono.CSharp {
                                        Type target_element_type = TypeManager.GetElementType (target_type);
                                                
                                        if (!expr_element_type.IsValueType && !target_element_type.IsValueType)
-                                               if (ImplicitStandardConversionExists (ConstantEC, MyEmptyExpr,
+                                               if (ImplicitStandardConversionExists (MyEmptyExpr,
                                                                                      target_element_type))
                                                        return true;
                                }
@@ -377,7 +377,7 @@ namespace Mono.CSharp {
                ///   expr is the expression to convert, returns a new expression of type
                ///   target_type or null if an implicit conversion is not possible.
                /// </summary>
-               static public Expression ImplicitNumericConversion (EmitContext ec, Expression expr,
+               static public Expression ImplicitNumericConversion (Expression expr,
                                                                    Type target_type)
                {
                        Type expr_type = expr.Type;
@@ -571,7 +571,7 @@ namespace Mono.CSharp {
                                        return true;
                        }
 
-                       if (ImplicitStandardConversionExists (ec, expr, target_type))
+                       if (ImplicitStandardConversionExists (expr, target_type))
                                return true;
 
                        Expression dummy = ImplicitUserConversion (ec, expr, target_type, Location.Null);
@@ -593,7 +593,7 @@ namespace Mono.CSharp {
                ///
                ///  ec should point to a real EmitContext if expr.Type is TypeManager.anonymous_method_type.
                /// </summary>
-               public static bool ImplicitStandardConversionExists (EmitContext ec, Expression expr, Type target_type)
+               public static bool ImplicitStandardConversionExists (Expression expr, Type target_type)
                {
                        Type expr_type = expr.Type;
 
@@ -716,18 +716,12 @@ namespace Mono.CSharp {
                                if (TypeManager.IsDelegateType (target_type) && RootContext.Version != LanguageVersion.ISO_1){
                                        MethodGroupExpr mg = expr as MethodGroupExpr;
                                        if (mg != null){
-                                               //
-                                               // This should not happen frequently, so we can create an object
-                                               // to test compatibility
-                                               //
-                                               Expression c = ImplicitDelegateCreation.Create (
-                                                       ec, mg, target_type, true, Location.Null);
-                                               return c != null;
+                                               return DelegateCreation.ImplicitStandardConversionExists (mg, target_type) != null;
                                        }
                                }
                        }
                        
-                       if (ImplicitReferenceConversionExists (ec, expr, target_type))
+                       if (ImplicitReferenceConversionExists (expr, target_type))
                                return true;
 
                        //
@@ -802,11 +796,7 @@ namespace Mono.CSharp {
                                if (!TypeManager.IsDelegateType (target_type))
                                        return false;
 
-                               AnonymousMethod am = (AnonymousMethod) expr;
-
-                               Expression conv = am.Compatible (ec, target_type, true);
-                               if (conv != null)
-                                       return true;
+                               return true;
                        }
 
                        return false;
@@ -816,7 +806,7 @@ namespace Mono.CSharp {
                ///  Finds "most encompassed type" according to the spec (13.4.2)
                ///  amongst the methods in the MethodGroupExpr
                /// </summary>
-               static Type FindMostEncompassedType (EmitContext ec, ArrayList types)
+               static Type FindMostEncompassedType (ArrayList types)
                {
                        Type best = null;
 
@@ -835,7 +825,7 @@ namespace Mono.CSharp {
                                }
 
                                expr.SetType (t);
-                               if (ImplicitStandardConversionExists (ec, expr, best))
+                               if (ImplicitStandardConversionExists (expr, best))
                                        best = t;
                        }
 
@@ -843,7 +833,7 @@ namespace Mono.CSharp {
                        foreach (Type t in types) {
                                if (best == t)
                                        continue;
-                               if (!ImplicitStandardConversionExists (ec, expr, t)) {
+                               if (!ImplicitStandardConversionExists (expr, t)) {
                                        best = null;
                                        break;
                                }
@@ -858,7 +848,7 @@ namespace Mono.CSharp {
                ///  Finds "most encompassing type" according to the spec (13.4.2)
                ///  amongst the types in the given set
                /// </summary>
-               static Type FindMostEncompassingType (EmitContext ec, ArrayList types)
+               static Type FindMostEncompassingType (ArrayList types)
                {
                        Type best = null;
 
@@ -877,7 +867,7 @@ namespace Mono.CSharp {
                                }
 
                                expr.SetType (best);
-                               if (ImplicitStandardConversionExists (ec, expr, t))
+                               if (ImplicitStandardConversionExists (expr, t))
                                        best = t;
                        }
 
@@ -885,7 +875,7 @@ namespace Mono.CSharp {
                                if (best == t)
                                        continue;
                                expr.SetType (t);
-                               if (!ImplicitStandardConversionExists (ec, expr, best)) {
+                               if (!ImplicitStandardConversionExists (expr, best)) {
                                        best = null;
                                        break;
                                }
@@ -901,7 +891,7 @@ namespace Mono.CSharp {
                ///   by making use of FindMostEncomp* methods. Applies the correct rules separately
                ///   for explicit and implicit conversion operators.
                /// </summary>
-               static public Type FindMostSpecificSource (EmitContext ec, IList list,
+               static public Type FindMostSpecificSource (IList list,
                                                           Expression source, bool apply_explicit_conv_rules)
                {
                        ArrayList src_types_set = new ArrayList ();
@@ -927,27 +917,27 @@ namespace Mono.CSharp {
                                ArrayList candidate_set = new ArrayList ();
 
                                foreach (Type param_type in src_types_set){
-                                       if (ImplicitStandardConversionExists (ec, source, param_type))
+                                       if (ImplicitStandardConversionExists (source, param_type))
                                                candidate_set.Add (param_type);
                                }
 
                                if (candidate_set.Count != 0)
-                                       return FindMostEncompassedType (ec, candidate_set);
+                                       return FindMostEncompassedType (candidate_set);
                        }
 
                        //
                        // Final case
                        //
                        if (apply_explicit_conv_rules)
-                               return FindMostEncompassingType (ec, src_types_set);
+                               return FindMostEncompassingType (src_types_set);
                        else
-                               return FindMostEncompassedType (ec, src_types_set);
+                               return FindMostEncompassedType (src_types_set);
                }
 
                /// <summary>
                ///  Finds the most specific target Tx according to section 13.4.4
                /// </summary>
-               static public Type FindMostSpecificTarget (EmitContext ec, IList list,
+               static public Type FindMostSpecificTarget (IList list,
                                                           Type target, bool apply_explicit_conv_rules)
                {
                        ArrayList tgt_types_set = new ArrayList ();
@@ -974,23 +964,23 @@ namespace Mono.CSharp {
                                foreach (Type ret_type in tgt_types_set){
                                        expr.SetType (ret_type);
                                        
-                                       if (ImplicitStandardConversionExists (ec, expr, target))
+                                       if (ImplicitStandardConversionExists (expr, target))
                                                candidate_set.Add (ret_type);
                                }
 
                                EmptyExpression.Release (expr);
 
                                if (candidate_set.Count != 0)
-                                       return FindMostEncompassingType (ec, candidate_set);
+                                       return FindMostEncompassingType (candidate_set);
                        }
                        
                        //
                        // Okay, final case !
                        //
                        if (apply_explicit_conv_rules)
-                               return FindMostEncompassedType (ec, tgt_types_set);
+                               return FindMostEncompassedType (tgt_types_set);
                        else 
-                               return FindMostEncompassingType (ec, tgt_types_set);
+                               return FindMostEncompassingType (tgt_types_set);
                }
                
                /// <summary>
@@ -1011,7 +1001,7 @@ namespace Mono.CSharp {
                        return UserDefinedConversion (ec, source, target, loc, true);
                }
 
-               static void AddConversionOperators (EmitContext ec, ArrayList list, 
+               static void AddConversionOperators (ArrayList list, 
                                                    Expression source, Type target_type, 
                                                    bool look_for_explicit,
                                                    MethodGroupExpr mg)
@@ -1027,22 +1017,22 @@ namespace Mono.CSharp {
                                Type arg_type = pd.ParameterType (0);
 
                                if (source_type != arg_type) {
-                                       if (!ImplicitStandardConversionExists (ec, source, arg_type)) {
+                                       if (!ImplicitStandardConversionExists (source, arg_type)) {
                                                if (!look_for_explicit)
                                                        continue;
                                                expr.SetType (arg_type);
-                                               if (!ImplicitStandardConversionExists (ec, expr, source_type))
+                                               if (!ImplicitStandardConversionExists (expr, source_type))
                                                        continue;
                                        }
                                }
 
                                if (target_type != return_type) {
                                        expr.SetType (return_type);
-                                       if (!ImplicitStandardConversionExists (ec, expr, target_type)) {
+                                       if (!ImplicitStandardConversionExists (expr, target_type)) {
                                                if (!look_for_explicit)
                                                        continue;
                                                expr.SetType (target_type);
-                                               if (!ImplicitStandardConversionExists (ec, expr, return_type))
+                                               if (!ImplicitStandardConversionExists (expr, return_type))
                                                        continue;
                                        }
                                }
@@ -1064,20 +1054,20 @@ namespace Mono.CSharp {
                        Type source_type = source.Type;
 
                        if (source_type != TypeManager.decimal_type) {
-                               AddConversionOperators (ec, ops, source, target_type, look_for_explicit,
+                               AddConversionOperators (ops, source, target_type, look_for_explicit,
                                        Expression.MethodLookup (ec, source_type, "op_Implicit", Location.Null) as MethodGroupExpr);
                                if (look_for_explicit) {
-                                       AddConversionOperators (ec, ops, source, target_type, look_for_explicit,
+                                       AddConversionOperators (ops, source, target_type, look_for_explicit,
                                                Expression.MethodLookup (
                                                        ec, source_type, "op_Explicit", Location.Null) as MethodGroupExpr);
                                }
                        }
 
                        if (target_type != TypeManager.decimal_type) {
-                               AddConversionOperators (ec, ops, source, target_type, look_for_explicit,
+                               AddConversionOperators (ops, source, target_type, look_for_explicit,
                                        Expression.MethodLookup (ec, target_type, "op_Implicit", Location.Null) as MethodGroupExpr);
                                if (look_for_explicit) {
-                                       AddConversionOperators (ec, ops, source, target_type, look_for_explicit,
+                                       AddConversionOperators (ops, source, target_type, look_for_explicit,
                                                Expression.MethodLookup (
                                                        ec, target_type, "op_Explicit", Location.Null) as MethodGroupExpr);
                                }
@@ -1086,11 +1076,11 @@ namespace Mono.CSharp {
                        if (ops.Count == 0)
                                return null;
 
-                       Type most_specific_source = FindMostSpecificSource (ec, ops, source, look_for_explicit);
+                       Type most_specific_source = FindMostSpecificSource (ops, source, look_for_explicit);
                        if (most_specific_source == null)
                                return null;
 
-                       Type most_specific_target = FindMostSpecificTarget (ec, ops, target_type, look_for_explicit);
+                       Type most_specific_target = FindMostSpecificTarget (ops, target_type, look_for_explicit);
                        if (most_specific_target == null)
                                return null;
 
@@ -1241,11 +1231,11 @@ namespace Mono.CSharp {
                        if (expr_type.Equals (target_type) && !TypeManager.IsNullType (expr_type))
                                return expr;
 
-                       e = ImplicitNumericConversion (ec, expr, target_type);
+                       e = ImplicitNumericConversion (expr, target_type);
                        if (e != null)
                                return e;
 
-                       e = ImplicitReferenceConversion (ec, expr, target_type);
+                       e = ImplicitReferenceConversion (expr, target_type);
                        if (e != null)
                                return e;
                        
index 8d12d85a97410ddfa041ec8889bf53b238ddbb48..1eb4ff8b3193dceb249ca3c9602f23b780aeaf27 100644 (file)
@@ -396,11 +396,10 @@ namespace Mono.CSharp {
                // Returns the MethodBase for "Invoke" from a delegate type, this is used
                // to extract the signature of a delegate.
                //
-               public static MethodGroupExpr GetInvokeMethod (EmitContext ec, Type delegate_type,
-                                                              Location loc)
+               public static MethodGroupExpr GetInvokeMethod (Type container_type, Type delegate_type, Location loc)
                {
-                       Expression ml = Expression.MemberLookup (
-                               ec, delegate_type, "Invoke", loc);
+                       Expression ml = Expression.MemberLookup (container_type, null, delegate_type,
+                               "Invoke", loc);
 
                        MethodGroupExpr mg = ml as MethodGroupExpr;
                        if (mg == null) {
@@ -415,11 +414,11 @@ namespace Mono.CSharp {
                ///  Verifies whether the method in question is compatible with the delegate
                ///  Returns the method itself if okay and null if not.
                /// </summary>
-               public static MethodBase VerifyMethod (EmitContext ec, Type delegate_type,
+               public static MethodBase VerifyMethod (Type container_type, Type delegate_type,
                                                       MethodGroupExpr old_mg, MethodBase mb,
                                                       Location loc)
                {
-                       MethodGroupExpr mg = GetInvokeMethod (ec, delegate_type, loc);
+                       MethodGroupExpr mg = GetInvokeMethod (container_type, delegate_type, loc);
                        if (mg == null)
                                return null;
 
@@ -430,7 +429,7 @@ namespace Mono.CSharp {
                        ParameterData invoke_pd = TypeManager.GetParameterData (invoke_mb);
 
                        if (!mg.HasTypeArguments &&
-                           !TypeManager.InferTypeArguments (ec, invoke_pd, ref mb))
+                           !TypeManager.InferTypeArguments (invoke_pd, ref mb))
                                return null;
 
                        ParameterData pd = TypeManager.GetParameterData (mb);
@@ -682,7 +681,7 @@ namespace Mono.CSharp {
                        string delegate_desc = Delegate.FullDelegateDesc (type, method, param);
 
                        if (!mg.HasTypeArguments &&
-                           !TypeManager.InferTypeArguments (ec, param, ref found_method))
+                           !TypeManager.InferTypeArguments (param, ref found_method))
                                Report.Error (411, loc, "The type arguments for " +
                                              "method `{0}' cannot be infered from " +
                                              "the usage. Try specifying the type " +
@@ -723,11 +722,21 @@ namespace Mono.CSharp {
                        return true;
                }
 
+               public static MethodBase ImplicitStandardConversionExists (MethodGroupExpr mg, Type targetType)
+               {
+                       foreach (MethodInfo mi in mg.Methods){
+                               MethodBase mb = Delegate.VerifyMethod (mg.DeclaringType, targetType, mg, mi, Location.Null);
+                               if (mb != null)
+                                       return mb;
+                       }
+                       return null;
+               }
+
                protected Expression ResolveMethodGroupExpr (EmitContext ec, MethodGroupExpr mg,
                                                             bool check_only)
                {
                        foreach (MethodInfo mi in mg.Methods){
-                               delegate_method  = Delegate.VerifyMethod (ec, type, mg, mi, loc);
+                               delegate_method  = Delegate.VerifyMethod (ec.ContainerType, type, mg, mi, loc);
                                
                                if (delegate_method != null)
                                        break;
index 3a18a8692202af78799a3b37127f51acb0a9c389..2d9e2b8b830f0de2ce724f89ecd9d6655343d344 100644 (file)
@@ -1454,7 +1454,7 @@ namespace Mono.CSharp {
                                return this;
                        }
 
-                       if (!Convert.ImplicitStandardConversionExists (Convert.ConstantEC, this, type)){
+                       if (!Convert.ImplicitStandardConversionExists (this, type)){
                                Error_ValueCannotBeConverted (loc, type, false);
                                return null;
                        }
index 7f1b90ad1f2537a057003fb48318587798d039cf..57c438320c0ed95916e2707ff0468bd66de6ffe7 100644 (file)
@@ -1612,7 +1612,7 @@ namespace Mono.CSharp {
                                                        if (ll >= 0)
                                                                right = new ULongConstant ((ulong) ll, right.Location);
                                                } else {
-                                                       e = Convert.ImplicitNumericConversion (ec, right, l);
+                                                       e = Convert.ImplicitNumericConversion (right, l);
                                                        if (e != null)
                                                                right = e;
                                                }
@@ -1629,7 +1629,7 @@ namespace Mono.CSharp {
                                                if (ll > 0)
                                                        left = new ULongConstant ((ulong) ll, right.Location);
                                        } else {
-                                               e = Convert.ImplicitNumericConversion (ec, left, r);
+                                               e = Convert.ImplicitNumericConversion (left, r);
                                                if (e != null)
                                                        left = e;
                                        }
@@ -2030,9 +2030,9 @@ namespace Mono.CSharp {
                                        // Also, a standard conversion must exist from either one
                                        //
                                        bool left_to_right =
-                                               Convert.ImplicitStandardConversionExists (ec, left, r);
+                                               Convert.ImplicitStandardConversionExists (left, r);
                                        bool right_to_left = !left_to_right &&
-                                               Convert.ImplicitStandardConversionExists (ec, right, l);
+                                               Convert.ImplicitStandardConversionExists (right, l);
 
                                        if (!left_to_right && !right_to_left) {
                                                Error_OperatorCannotBeApplied ();
@@ -4653,7 +4653,7 @@ namespace Mono.CSharp {
                                                 ref MethodBase candidate)
                {
                        if (!me.HasTypeArguments &&
-                           !TypeManager.InferTypeArguments (ec, arguments, ref candidate))
+                           !TypeManager.InferTypeArguments (arguments, ref candidate))
                                return false;
 
                        return IsApplicable (ec, arguments, arg_count, candidate);
@@ -4846,7 +4846,7 @@ namespace Mono.CSharp {
                                        if (pd.Count != arg_count)
                                                continue;
 
-                                       if (!TypeManager.InferTypeArguments (ec, Arguments, ref c))
+                                       if (!TypeManager.InferTypeArguments (Arguments, ref c))
                                                continue;
 
                                        VerifyArgumentsCompat (ec, Arguments, arg_count,
@@ -4872,7 +4872,7 @@ namespace Mono.CSharp {
                                                if (pd.Count != arg_count)
                                                        continue;
 
-                                               if (TypeManager.InferTypeArguments (ec, Arguments, ref c))
+                                               if (TypeManager.InferTypeArguments (Arguments, ref c))
                                                        continue;
 
                                                Report.Error (
index 3fb6ce9251fd8852b4e6c1b5227eca979269cce9..eaf013833f463c436274879607f2980db57dd65a 100644 (file)
@@ -442,8 +442,8 @@ namespace Mono.CSharp {
                                Type t2 = constraints.ClassConstraint;
                                TypeExpr e2 = constraints.class_constraint;
 
-                               if (!Convert.ImplicitReferenceConversionExists (ec, e1, t2) &&
-                                   !Convert.ImplicitReferenceConversionExists (ec, e2, t1)) {
+                               if (!Convert.ImplicitReferenceConversionExists (e1, t2) &&
+                                   !Convert.ImplicitReferenceConversionExists (e2, t1)) {
                                        Report.Error (455, loc,
                                                      "Type parameter `{0}' inherits " +
                                                      "conflicting constraints `{1}' and `{2}'",
@@ -1548,7 +1548,7 @@ namespace Mono.CSharp {
                        if (TypeManager.IsBuiltinType (atype) || atype.IsValueType)
                                return true;
 
-                       if (HasDefaultConstructor (ec, atype))
+                       if (HasDefaultConstructor (ec.ContainerType, atype))
                                return true;
 
                        Report_SymbolRelatedToPreviousError ();
@@ -1590,14 +1590,14 @@ namespace Mono.CSharp {
                                ctype = atypes [pos];
                        }
 
-                       if (Convert.ImplicitStandardConversionExists (ec, expr, ctype))
+                       if (Convert.ImplicitStandardConversionExists (expr, ctype))
                                return true;
 
                        Error_TypeMustBeConvertible (expr.Type, ctype, ptype);
                        return false;
                }
 
-               bool HasDefaultConstructor (EmitContext ec, Type atype)
+               bool HasDefaultConstructor (Type containerType, Type atype)
                {
                        atype = TypeManager.DropGenericTypeArguments (atype);
 
@@ -1620,7 +1620,7 @@ namespace Mono.CSharp {
                        }
 
                        MethodGroupExpr mg = Expression.MemberLookup (
-                               ec.ContainerType, atype, ".ctor", MemberTypes.Constructor,
+                               containerType, atype, ".ctor", MemberTypes.Constructor,
                                BindingFlags.Public | BindingFlags.Instance |
                                BindingFlags.DeclaredOnly, loc)
                                as MethodGroupExpr;
@@ -2555,7 +2555,7 @@ namespace Mono.CSharp {
                ///   when resolving an Invocation or a DelegateInvocation and the user
                ///   did not explicitly specify type arguments.
                /// </summary>
-               public static bool InferTypeArguments (EmitContext ec, ArrayList arguments,
+               public static bool InferTypeArguments (ArrayList arguments,
                                                       ref MethodBase method)
                {
                        if (!TypeManager.IsGenericMethod (method))
@@ -2609,7 +2609,7 @@ namespace Mono.CSharp {
                /// <summary>
                ///   Type inference.
                /// </summary>
-               public static bool InferTypeArguments (EmitContext ec, ParameterData apd,
+               public static bool InferTypeArguments (ParameterData apd,
                                                       ref MethodBase method)
                {
                        if (!TypeManager.IsGenericMethod (method))