This commit is contained in:
Бондарев Иван 2017-07-06 20:57:32 +02:00
parent 485d6b4445
commit 078ff0b6ee
2 changed files with 15 additions and 2 deletions

View file

@ -0,0 +1,13 @@
type TClass = class
class i: integer := 2;
class constructor Create;
begin
var lmb: integer -> integer := x -> i;
assert(lmb(2) = 2);
end;
end;
begin
var obj := new TClass;
end.

View file

@ -179,7 +179,7 @@ namespace TreeConverter.LambdaExpressions.Closure
return; return;
} }
if (si.sym_info.semantic_node_type == semantic_node_type.class_field && InLambdaContext) /*if (si.sym_info.semantic_node_type == semantic_node_type.class_field && InLambdaContext)
{ {
var semClassField = (class_field)si.sym_info; var semClassField = (class_field)si.sym_info;
if (semClassField.polymorphic_state != polymorphic_state.ps_common) if (semClassField.polymorphic_state != polymorphic_state.ps_common)
@ -187,7 +187,7 @@ namespace TreeConverter.LambdaExpressions.Closure
_visitor.AddError(new ThisTypeOfVariablesCannotBeCaptured(_visitor.get_location(id))); _visitor.AddError(new ThisTypeOfVariablesCannotBeCaptured(_visitor.get_location(id)));
return; return;
} }
} }*/
if (si.scope == null) if (si.scope == null)
{ {