diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index e618386c5..abe10e429 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 = "6"; public const string Build = "2"; - public const string Revision = "2391"; + public const string Revision = "2392"; 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 6d1f870e5..94408f748 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=6 -%REVISION%=2391 %COREVERSION%=2 +%REVISION%=2392 +%MINOR%=6 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 024c3556b..9d526150b 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.6.2.2391 +3.6.2.2392 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 17b1528bd..da1dd9419 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.6.2.2391' +!define VERSION '3.6.2.2392' diff --git a/TestSuite/implicitInInit.pas b/TestSuite/implicitInInit.pas new file mode 100644 index 000000000..0536367dd --- /dev/null +++ b/TestSuite/implicitInInit.pas @@ -0,0 +1,16 @@ +type + MyString = class + public + d: string; + static function operator implicit(s: string): MyString; + begin + Result := new MyString; + Result.d := s; + end; + + end; + +begin + var s: MyString := 'abcde'; + Assert(s.d = 'abcde'); +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 501adcd49..91727a4ec 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -14310,7 +14310,13 @@ namespace PascalABCCompiler.TreeConverter private expression_node convert_strong_to_constant_or_function_call_for_varinit(expression_node exp, type_node tn) { if (exp is constant_node) - return convert_strong_to_constant_node(exp, tn); + { + possible_type_convertions pct = type_table.get_convertions(exp.type, tn); + if (pct.first != null && pct.first.convertion_method.IsOperator) + //if (convertion_data_and_alghoritms.can_convert_type(exp, tn)) + return convertion_data_and_alghoritms.convert_type(exp, tn); + else return convert_strong_to_constant_node(exp, tn); + } if (exp is array_initializer) { //if (tn.type_special_kind != SemanticTree.type_special_kind.array_wrapper)