diff options
author | Miguel de Icaza <miguel@gnome.org> | 2002-11-20 01:32:19 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2002-11-20 01:32:19 +0300 |
commit | 2e561bb2d3bc0840469f2dd7ba438d9b96bea734 (patch) | |
tree | 1f989cc6e3fc4d5855a9d470836fd3f170db5ceb | |
parent | 71e4f3fbbf75409899002f6d1526441dd546a885 (diff) |
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.
svn path=/trunk/mcs/; revision=9095
-rwxr-xr-x | mcs/mcs/ChangeLog | 7 | ||||
-rwxr-xr-x | mcs/mcs/ecore.cs | 7 | ||||
-rwxr-xr-x | mcs/mcs/statement.cs | 6 |
3 files changed, 15 insertions, 5 deletions
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 203de541f63..4faa49297e4 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,10 @@ +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. diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index b0d1c9ef09c..dab630d3f17 100755 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -2875,8 +2875,11 @@ namespace Mono.CSharp { 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) diff --git a/mcs/mcs/statement.cs b/mcs/mcs/statement.cs index d8b5673e11e..9714d9107ec 100755 --- a/mcs/mcs/statement.cs +++ b/mcs/mcs/statement.cs @@ -843,7 +843,7 @@ namespace Mono.CSharp { 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"); @@ -2995,7 +2995,7 @@ namespace Mono.CSharp { continue; if (e is EmptyCast) - e = ((EmptyCast) e).Child; + e = ((EmptyCast) e).Peel (); if (!(e is Constant)){ Report.Error (133, vi.Location, @@ -3180,7 +3180,7 @@ namespace Mono.CSharp { return false; if (e is EmptyCast) - e = ((EmptyCast) e).Child; + e = ((EmptyCast) e).Peel (); if (!(e is Constant)){ Console.WriteLine ("Value is: " + label); |