2005-01-19 Sureshkumar T <tsureshkumar@novell.com>
[mono.git] / mcs / gmcs / convert.cs
index 32647f4f602763f4ccf02dde66d1c8bb990628d9..e6bdf4674c0c7a0c35c58e5000ac1e8785e4e066 100644 (file)
@@ -29,7 +29,7 @@ namespace Mono.CSharp {
                //
                public static EmitContext ConstantEC = null;
                
-               static void Error_CannotConvertType (Location loc, Type source, Type target)
+               static public void Error_CannotConvertType (Location loc, Type source, Type target)
                {
                        Report.Error (30, loc, "Cannot convert type '" +
                                      TypeManager.CSharpName (source) + "' to '" +
@@ -168,7 +168,7 @@ namespace Mono.CSharp {
                                if (TypeManager.IsValueType (expr_type))
                                        return new BoxedCast (expr);
                                if (expr_type.IsClass || expr_type.IsInterface || expr_type == TypeManager.enum_type){
-                                       if (target_type == TypeManager.anonymous_method_type)
+                                       if (expr_type == TypeManager.anonymous_method_type)
                                                return null;
                                        return new EmptyCast (expr, target_type);
                                }
@@ -1331,7 +1331,7 @@ namespace Mono.CSharp {
                                //
                                // Possibly, we need to create a different 0 literal before passing
                                // to EnumConstant
-                               //n
+                               //
                                if (underlying == TypeManager.int64_type)
                                        e = new LongLiteral (0);
                                else if (underlying == TypeManager.uint64_type)
@@ -1344,6 +1344,13 @@ namespace Mono.CSharp {
 
                static public void Error_CannotImplicitConversion (Location loc, Type source, Type target)
                {
+                       if (source.Name == target.Name){
+                               Report.ExtraInformation (loc,
+                                        String.Format (
+                                               "The type {0} has two conflicting definitons, one comes from {0} and the other from {1}",
+                                               source.Assembly.FullName, target.Assembly.FullName));
+                                                        
+                       }
                        Report.Error (29, loc, "Cannot convert implicitly from {0} to `{1}'",
                                      source == TypeManager.anonymous_method_type ?
                                      "anonymous method" : "`" + TypeManager.CSharpName (source) + "'",