Nothing to see here
[mono.git] / mcs / mcs / convert.cs
index 55e6831fd5975393af2f7f9838222155778e3f2d..931fe82665de4c930e87dc52bccbbcfcb7dc54ec 100644 (file)
@@ -673,6 +673,17 @@ namespace Mono.CSharp {
                        if (expr_type == TypeManager.void_type)
                                return false;
 
+                       if (expr.eclass == ExprClass.MethodGroup) {
+                               if (TypeManager.IsDelegateType (target_type) && RootContext.Version != LanguageVersion.ISO_1) {
+                                       MethodGroupExpr mg = expr as MethodGroupExpr;
+                                       if (mg != null) {
+                                               return DelegateCreation.ImplicitStandardConversionExists (mg, target_type) != null;
+                                       }
+                               }
+
+                               return false;
+                       }
+
                        //Console.WriteLine ("Expr is {0}", expr);
                        //Console.WriteLine ("{0} -> {1} ?", expr_type, target_type);
                        if (TypeManager.IsEqual (expr_type, target_type))
@@ -785,17 +796,6 @@ namespace Mono.CSharp {
                                        return true;
                        }
 
-                       if (expr.eclass == ExprClass.MethodGroup){
-                               if (TypeManager.IsDelegateType (target_type) && RootContext.Version != LanguageVersion.ISO_1){
-                                       MethodGroupExpr mg = expr as MethodGroupExpr;
-                                       if (mg != null){
-                                               return DelegateCreation.ImplicitStandardConversionExists (mg, target_type) != null;
-                                       }
-                               }
-
-                               return false;
-                       }
-
                        if (ImplicitReferenceConversionExists (expr, target_type))
                                return true;
 
@@ -1238,7 +1238,7 @@ namespace Mono.CSharp {
                        if (source == null)
                                return null;
 
-                       return new UserCast (method, source, loc);
+                       return new UserCast (method, source, loc).DoResolve (ec);
                }
 
                /// <summary>
@@ -1394,7 +1394,7 @@ namespace Mono.CSharp {
                                }
 
                                if (expr_type == TypeManager.null_type && target_type.IsPointer)
-                                       return EmptyCast.Create (NullPointer.Null, target_type);
+                                       return EmptyCast.Create (new NullPointer (loc), target_type);
                        }
 
                        if (expr_type == TypeManager.anonymous_method_type){