Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2002-11-20 01:32:19 +0300
committerMiguel de Icaza <miguel@gnome.org>2002-11-20 01:32:19 +0300
commit2e561bb2d3bc0840469f2dd7ba438d9b96bea734 (patch)
tree1f989cc6e3fc4d5855a9d470836fd3f170db5ceb
parent71e4f3fbbf75409899002f6d1526441dd546a885 (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-xmcs/mcs/ChangeLog7
-rwxr-xr-xmcs/mcs/ecore.cs7
-rwxr-xr-xmcs/mcs/statement.cs6
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);