This commit is contained in:
parent
5ff789446b
commit
052d0e38a9
16
TestSuite/Deconstructs2.pas
Normal file
16
TestSuite/Deconstructs2.pas
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
var i: integer;
|
||||
type
|
||||
t1 = class
|
||||
procedure Deconstruct;
|
||||
begin
|
||||
i := 1;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
if new t1 is t1(var a) then
|
||||
begin
|
||||
i := 2;
|
||||
end;
|
||||
assert(i = 2);
|
||||
end.
|
||||
|
|
@ -93,6 +93,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
out type_node[] parameterTypes)
|
||||
{
|
||||
parameterTypes = new type_node[givenParameterTypes.Length];
|
||||
if (candidate.parameters.Count == 0)
|
||||
return false;
|
||||
candidate.parameters[0].name = "Self"; // SSM 23.06.20 #2268 - это если в NET где-то такое нашли
|
||||
var selfParameter = candidate.is_extension_method ? candidate.parameters.FirstOrDefault(IsSelfParameter) : null;
|
||||
Debug.Assert(!candidate.is_extension_method || selfParameter != null, "Couldn't find self parameter in extension method");
|
||||
|
|
|
|||
Loading…
Reference in a new issue