2002-05-06 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Mon, 6 May 2002 22:38:32 +0000 (22:38 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 6 May 2002 22:38:32 +0000 (22:38 -0000)
* assign.cs: Report the error, instead of failing silently

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

mcs/mcs/ChangeLog
mcs/mcs/assign.cs
mcs/mcs/statement.cs

index 0de47aa6ec4c30cf3fe683a10faaf57585fb43dd..46f56c0a3d24aad9581a48db2b2f8a9d0638aa6f 100755 (executable)
@@ -1,5 +1,7 @@
 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
 
+       * assign.cs: Report the error, instead of failing silently
+
        * rootcontext.cs (AddGlobalAttributes): Track attributes on the
        typecontainer that they are declared, because the
        typecontainer/namespace will have the list of using clauses that
index 3bbdd6bbd8d6609a09c8d4fc57cfc93ed340186c..bc3ee69d74ad2349ae4ef1d0e2f9708682dd2852 100755 (executable)
@@ -92,7 +92,7 @@ namespace Mono.CSharp {
        /// </summary>
        public class Assign : ExpressionStatement {
                Expression target, source;
-               Location l;
+               public Location l;
 
                public Assign (Expression target, Expression source, Location l)
                {
@@ -260,6 +260,7 @@ namespace Mono.CSharp {
                                        if (StandardConversionExists (a.original_source, target_type))
                                                return this;
 
+                                       Error_CannotConvertImplicit (l, source_type, target_type);
                                        return null;
                                }
                        }
index 21d653280537bb52f97d365e155659c30b7f6c20..5d0a87906e993502fe94a7473f92efc2d98242bf 100755 (executable)
@@ -134,13 +134,15 @@ namespace Mono.CSharp {
                public override bool Resolve (EmitContext ec)
                {
                        expr = ResolveBoolean (ec, expr, loc);
-                       if (expr == null)
+                       if (expr == null){
                                return false;
+                       }
                        
                        if (TrueStatement.Resolve (ec)){
                                if (FalseStatement != null){
                                        if (FalseStatement.Resolve (ec))
                                                return true;
+                                       
                                        return false;
                                }
                                return true;