+2010-05-21 Marek Safar <marek.safar@gmail.com>
+
+ * context.cs, expression.cs, cs-parser.jay: Don't store current
+ block in This expression (it's too early for linq blocks).
+
2010-05-21 Marek Safar <marek.safar@gmail.com>
* expression.cs: Use constrained prefix more broadly to avoid boxing.
// TODO: Merge with CompilerGeneratedThis
public Expression GetThis (Location loc)
{
- This my_this;
- if (CurrentBlock != null)
- my_this = new This (CurrentBlock, loc);
- else
- my_this = new This (loc);
+ This my_this = new This (loc);
if (!my_this.ResolveBase (this))
my_this = null;
if (type == null)
type = ec.CurrentType;
- is_struct = TypeManager.IsStruct (type);
return this;
}
}
}
- Block block;
VariableInfo variable_info;
- protected bool is_struct;
-
- public This (Block block, Location loc)
- {
- this.loc = loc;
- this.block = block;
- }
public This (Location loc)
{
}
public override bool IsRef {
- get { return is_struct; }
+ get { return type.IsStruct; }
}
protected override ILocalVariable Variable {
}
}
- is_struct = TypeManager.IsStruct (type);
-
+ var block = ec.CurrentBlock;
if (block != null) {
if (block.Toplevel.ThisVariable != null)
variable_info = block.Toplevel.ThisVariable.VariableInfo;
public override int GetHashCode()
{
- return block.GetHashCode ();
+ throw new NotImplementedException ();
}
public override string Name {
if (t == null)
return false;
- return block == t.block;
+ return true;
}
protected override void CloneTo (CloneContext clonectx, Expression t)
{
- This target = (This) t;
-
- target.block = clonectx.LookupBlock (block);
+ // Nothing
}
public override void SetHasAddressTaken ()