public Field AddCapturedVariable (string name, TypeSpec type)
{
CheckMembersDefined ();
FullNamedExpression field_type = new TypeExpression (type, Location);
if (!IsGeneric)
return AddCompilerGeneratedField (name, field_type);
const Modifiers mod = Modifiers.INTERNAL | Modifiers.COMPILER_GENERATED;
Field f = new HoistedField (this, field_type, mod, name, null, Location);
AddField (f);
return f;
}