fix #1990
This commit is contained in:
parent
0d31b9bc77
commit
99882270d0
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "5";
|
public const string Minor = "5";
|
||||||
public const string Build = "0";
|
public const string Build = "0";
|
||||||
public const string Revision = "2096";
|
public const string Revision = "2098";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%COREVERSION%=0
|
%COREVERSION%=0
|
||||||
%REVISION%=2096
|
%REVISION%=2098
|
||||||
%MINOR%=5
|
%MINOR%=5
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.5.0.2096'
|
!define VERSION '3.5.0.2098'
|
||||||
|
|
|
||||||
17
TestSuite/lambda_capture_local_before_begin.pas
Normal file
17
TestSuite/lambda_capture_local_before_begin.pas
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
type
|
||||||
|
t1<T>=class
|
||||||
|
procedure p1();
|
||||||
|
var t2: integer := 2;
|
||||||
|
begin
|
||||||
|
var p: procedure := ()->
|
||||||
|
begin
|
||||||
|
Assert(t2=2);
|
||||||
|
end;
|
||||||
|
p;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
T1&<integer>.Create.p1;
|
||||||
|
end.
|
||||||
|
|
@ -242,13 +242,13 @@ namespace TreeConverter.LambdaExpressions.Closure
|
||||||
var prScope = scope as CapturedVariablesTreeNodeProcedureScope;
|
var prScope = scope as CapturedVariablesTreeNodeProcedureScope;
|
||||||
if (prScope != null && acceptableVarType)
|
if (prScope != null && acceptableVarType)
|
||||||
{
|
{
|
||||||
if (si.sym_info.semantic_node_type == semantic_node_type.local_variable)
|
/*if (si.sym_info.semantic_node_type == semantic_node_type.local_variable)
|
||||||
{
|
{
|
||||||
if (!(idName == compiler_string_consts.self_word && si.scope is SymbolTable.ClassMethodScope && _classScope != null) && InLambdaContext)
|
if (!(idName == compiler_string_consts.self_word && si.scope is SymbolTable.ClassMethodScope && _classScope != null) && InLambdaContext)
|
||||||
{
|
{
|
||||||
_visitor.AddError(new ThisTypeOfVariablesCannotBeCaptured(_visitor.get_location(id)));
|
_visitor.AddError(new ThisTypeOfVariablesCannotBeCaptured(_visitor.get_location(id)));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
if (si.sym_info.semantic_node_type == semantic_node_type.common_parameter && prScope.FunctionNode.parameters.First(v => v.name.ToLower() == idName).parameter_type != parameter_type.value && InLambdaContext)
|
if (si.sym_info.semantic_node_type == semantic_node_type.common_parameter && prScope.FunctionNode.parameters.First(v => v.name.ToLower() == idName).parameter_type != parameter_type.value && InLambdaContext)
|
||||||
{
|
{
|
||||||
_visitor.AddError(new CannotCaptureNonValueParameters(_visitor.get_location(id)));
|
_visitor.AddError(new CannotCaptureNonValueParameters(_visitor.get_location(id)));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue