This commit is contained in:
Mikhalkovich Stanislav 2020-03-31 11:05:32 +03:00
parent fc2f9293a4
commit 4d5a1c458c
6 changed files with 28 additions and 6 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3"; public const string Major = "3";
public const string Minor = "6"; public const string Minor = "6";
public const string Build = "2"; public const string Build = "2";
public const string Revision = "2391"; public const string Revision = "2392";
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;

View file

@ -1,4 +1,4 @@
%MINOR%=6
%REVISION%=2391
%COREVERSION%=2 %COREVERSION%=2
%REVISION%=2392
%MINOR%=6
%MAJOR%=3 %MAJOR%=3

View file

@ -1 +1 @@
3.6.2.2391 3.6.2.2392

View file

@ -1 +1 @@
!define VERSION '3.6.2.2391' !define VERSION '3.6.2.2392'

View file

@ -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.

View file

@ -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) private expression_node convert_strong_to_constant_or_function_call_for_varinit(expression_node exp, type_node tn)
{ {
if (exp is constant_node) 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 (exp is array_initializer)
{ {
//if (tn.type_special_kind != SemanticTree.type_special_kind.array_wrapper) //if (tn.type_special_kind != SemanticTree.type_special_kind.array_wrapper)