Skip to content

Commit

Permalink
[639603] Don't emit statements as expressions when they don't support…
Browse files Browse the repository at this point in the history
… it.
  • Loading branch information
marek-safar authored and Andrew Jorgensen committed Sep 17, 2010
1 parent ef47ac3 commit f038e86
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions mcs/mcs/eval.cs
Expand Up @@ -1186,32 +1186,12 @@ protected override Expression DoResolve (ResolveContext ec)
}

// This means its really a statement.
if (clone.Type == TypeManager.void_type){
source = source.Resolve (ec);
target = null;
type = TypeManager.void_type;
eclass = ExprClass.Value;
return this;
if (clone.Type == TypeManager.void_type || clone is DynamicInvocation || clone is Assign) {
return clone;
}

return base.DoResolve (ec);
}

public override void Emit (EmitContext ec)
{
if (target == null)
source.Emit (ec);
else
base.Emit (ec);
}

public override void EmitStatement (EmitContext ec)
{
if (target == null)
source.Emit (ec);
else
base.EmitStatement (ec);
}
}

public class Undo {
Expand Down

0 comments on commit f038e86

Please sign in to comment.