2004-09-07 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Tue, 7 Sep 2004 18:33:17 +0000 (18:33 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 7 Sep 2004 18:33:17 +0000 (18:33 -0000)
* expression.cs: Apply patch from Ben: Remove dead code from
ArrayCreation, and remove the TurnintoConstant call in const.cs,
as that code just threw an exception anwyays.

* const.cs: Remove the call to the turnintoconstant, for details
see bug: #63144

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

mcs/mcs/const.cs
mcs/mcs/expression.cs

index ce276fd6160d2b767d9d6f10338f383897ec78a1..7c70fad611a1d9000577f3250230a11a4bc79a17 100755 (executable)
@@ -222,16 +222,7 @@ namespace Mono.CSharp {
                                        Expr = ch_expr.Expr;
                                else if ((ec_expr != null) && (ec_expr.Child is Constant))
                                        Expr = ec_expr.Child;
-                               else if (Expr is ArrayCreation) {
-                                       ArrayCreation ac = (ArrayCreation) Expr;
-
-                                       Expr = ac.TurnIntoConstant ();
-                                       if (Expr == null){
-                                               Report.Error (150, Location, "A constant value is expected");
-                                               value = null;
-                                               return false;
-                                       }
-                               } else {
+                               else {
                                        if (errors == Report.Errors)
                                                Report.Error (150, Location, "A constant value is expected");
                                        value = null;
index b172be215e63ce7d5c552e672bcdd077f4254527..bec3edaa72df77e9cc3e19177313043536cbd1bc 100755 (executable)
@@ -6494,16 +6494,6 @@ namespace Mono.CSharp {
                        }
                        return ret;
                }
-
-               public Expression TurnIntoConstant ()
-               {
-                       //
-                       // Should use something like the above attribute thing.
-                       // It should return a subclass of Constant that just returns
-                       // the computed value of the array
-                       //
-                       throw new Exception ("Does not support yet Turning array into a Constant");
-               }
        }
        
        /// <summary>