mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-02-19 18:16:35 +01:00
Codetools: Improve match of parameter array of record. (Earlier xxx commit belongs to this). Issue #39494, patch by Włodzimierz Bień.
This commit is contained in:
parent
aa15430072
commit
13ccaf0c22
@ -13516,7 +13516,6 @@ begin
|
||||
TargetParams:= TFindDeclarationParams.Create(Params);
|
||||
TargetParams.SetIdentifier(Self,nil,nil);
|
||||
TargetParams.Flags:=fdfDefaultForExpressions;
|
||||
ExprOfElement:=CleanExpressionType;
|
||||
ExprOfElement:=
|
||||
FindExpressionTypeOfTerm(TargetNode.FirstChild.StartPos,-1,Params,false);
|
||||
if ExprOfElement.Desc=xtContext then
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
unit test_param_array_of_record;
|
||||
|
||||
{$mode ObjFPC}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
type
|
||||
T = record
|
||||
a: byte;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
function x(a: byte): T;
|
||||
begin
|
||||
result.a:=a;
|
||||
end;
|
||||
|
||||
procedure Foo(s: integer); overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure Foo(s: integer; const b: array of T); overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure Foo(s: string; c: byte; const b: array of T); overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
Foo(1);
|
||||
Foo{findrefs:11,23;3,34}(1, [x(1), x(2)]);
|
||||
Foo{findrefs:11,27;3,35}('abc', 1, [x(1), x(2)]);
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user