diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index d02a211e4..713dab77b 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "5"; public const string Build = "0"; - public const string Revision = "2153"; + public const string Revision = "2155"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index a8cbaaee1..f9e3f858e 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=5 -%REVISION%=2153 +%REVISION%=2155 %COREVERSION%=0 %MAJOR%=3 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 73786856e..5644806fd 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.5.0.2153' +!define VERSION '3.5.0.2155' diff --git a/TestSuite/lambda_generic_method_only.pas b/TestSuite/lambda_generic_method_only.pas new file mode 100644 index 000000000..5e93d9e40 --- /dev/null +++ b/TestSuite/lambda_generic_method_only.pas @@ -0,0 +1,15 @@ +type + t0 = class end; + + t1 = class + function f1(q: t0) := default(T); + + procedure p1; + begin + var a: t0; + var f: Func0 := ()->self.f1(a); + end; + end; + +begin +end. diff --git a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs index f37987804..75c49864e 100644 --- a/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs +++ b/TreeConverter/LambdaExpressions/Closure/CapturedVariablesSubstitutor.cs @@ -879,7 +879,7 @@ namespace TreeConverter.LambdaExpressions.Closure { var genericParameters = AllGenericParameters; - if (_visitor.context._ctn != null && _visitor.context._ctn.generic_params != null) + if (_visitor.context._ctn != null /* && _visitor.context._ctn.generic_params != null */) { var tr = upperField.vars_type as named_type_reference; if (tr != null && tr.names != null && tr.names.Count == 1) @@ -891,10 +891,11 @@ namespace TreeConverter.LambdaExpressions.Closure } } - upperField.vars_type = - new template_type_reference( - (named_type_reference)upperField.vars_type, - new template_param_list(genericParameters.Select(l => SyntaxTreeBuilder.BuildSimpleType(l.name)).ToList())); + if (genericParameters.Count > 0) + upperField.vars_type = // SSM 26/06/19 - было вне if - поставил в if - #1947 - что-то легло. Оставил вне if + new template_type_reference( + (named_type_reference)upperField.vars_type, + new template_param_list(genericParameters.Select(l => SyntaxTreeBuilder.BuildSimpleType(l.name)).ToList())); } if (clDecl.Value.GeneratedVarStatementForScope != null) @@ -938,6 +939,14 @@ namespace TreeConverter.LambdaExpressions.Closure } } + private bool IsInGenericClass + { + get + { + return _visitor.context._ctn != null && _visitor.context._ctn.generic_params != null; + + } + } private List AllGenericParameters { get