bool defined;
bool referenced;
Label label;
+ ILGenerator ig;
FlowBranching.UsageVector vectors;
{
if (defined)
return label;
+ ig = ec.ig;
label = ec.ig.DefineLabel ();
defined = true;
protected override void DoEmit (EmitContext ec)
{
+ if (ig != null && ig != ec.ig) {
+ Report.Error (1632, "Control cannot leave body of anonymous method");
+ return;
+ }
LabelTarget (ec);
ec.ig.MarkLabel (label);
}
// </summary>
public LocalInfo ThisVariable {
get {
- if (this_variable != null)
- return this_variable;
- else if (Parent != null)
- return Parent.ThisVariable;
- else
- return null;
+ for (Block b = this; b != null; b = b.Parent) {
+ if (b.this_variable != null)
+ return b.this_variable;
+ }
+
+ return null;
}
}
if (expr == null)
return false;
+ if (expr is NullLiteral) {
+ Report.Error (186, expr.Location, "Use of null is not valid in this context");
+ return false;
+ }
+
TypeExpr texpr = type.ResolveAsTypeTerminal (ec, false);
if (texpr == null)
return false;