* statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
GotoCase.Resolve): Use Peel on EmpytCasts.
* ecore.cs (EmptyCast): drop child, add Peel method.
svn path=/trunk/mcs/; revision=9095
+2002-11-19 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
+ GotoCase.Resolve): Use Peel on EmpytCasts.
+
+ * ecore.cs (EmptyCast): drop child, add Peel method.
+
2002-11-17 Martin Baulig <martin@ximian.com>
* ecore.cs (EmptyCast.Child): New public property.
this.child = child;
}
- public Expression Child {
- get { return child; }
+ public Expression Peel ()
+ {
+ if (child is EmptyCast)
+ return ((EmptyCast) child).Peel ();
+ return child;
}
public override Expression DoResolve (EmitContext ec)
return false;
if (expr is EmptyCast)
- expr = ((EmptyCast) expr).Child;
+ expr = ((EmptyCast) expr).Peel ();
if (!(expr is Constant)){
Report.Error (159, loc, "Target expression for goto case is not constant");
continue;
if (e is EmptyCast)
- e = ((EmptyCast) e).Child;
+ e = ((EmptyCast) e).Peel ();
if (!(e is Constant)){
Report.Error (133, vi.Location,
return false;
if (e is EmptyCast)
- e = ((EmptyCast) e).Child;
+ e = ((EmptyCast) e).Peel ();
if (!(e is Constant)){
Console.WriteLine ("Value is: " + label);