2002-10-08 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Tue, 8 Oct 2002 23:22:09 +0000 (23:22 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 8 Oct 2002 23:22:09 +0000 (23:22 -0000)
* ecore.cs (Expression.ConvertExplicit): One codepath could return
errors but not flag them.  Fix this.  Fixes #31853

svn path=/trunk/mcs/; revision=8080

mcs/mcs/ChangeLog
mcs/mcs/ecore.cs

index e783edac500517acb88acf1e3c35906857a56f29..3ba30162f8ec64465ca3f2412fae61faec2aba16 100755 (executable)
@@ -1,5 +1,8 @@
 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
 
+       * ecore.cs (Expression.ConvertExplicit): One codepath could return
+       errors but not flag them.  Fix this.  Fixes #31853
+       
        * parameter.cs (Resolve): Do not allow void as a parameter type.
 
 2002-10-06  Martin Baulig  <martin@gnome.org>
index db2fb37825d7a743937918d0645aa5d5867a2d4e..027ea74aa31fb171d13700d5f9b388ceefff1e03 100755 (executable)
@@ -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);