2002-10-08 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / ecore.cs
index 715ca45698c7f5b4a19faf11786fcb0421fd1ee9..027ea74aa31fb171d13700d5f9b388ceefff1e03 100755 (executable)
@@ -1759,7 +1759,7 @@ namespace Mono.CSharp {
                                              "Double literal cannot be implicitly converted to " +
                                              "float type, use F suffix to create a float literal");
                        }
-                       
+
                        Error_CannotConvertImplicit (loc, source.Type, target_type);
 
                        return null;
@@ -2217,7 +2217,12 @@ namespace Mono.CSharp {
                                if (t != null)
                                        return t;
                                
-                               return ConvertNumericExplicit (ec, e, target_type, loc);
+                               t = ConvertNumericExplicit (ec, e, target_type, loc);
+                               if (t != null)
+                                       return t;
+                               
+                               Error_CannotConvertType (loc, expr_type, target_type);
+                               return null;
                        }
                        
                        ne = ConvertReferenceExplicit (expr, target_type);