mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 21:28:03 +02:00
* ignore errors in setlength parsing inside a generic functin, resolves #20557
git-svn-id: trunk@19561 -
This commit is contained in:
parent
2df900652e
commit
5d4607f65a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11888,6 +11888,7 @@ tests/webtbs/tw20421.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2045.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2046a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw20527.pp svneol=native#text/plain
|
||||
tests/webtbs/tw20557.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2059.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2065.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2069.pp svneol=native#text/plain
|
||||
|
@ -57,7 +57,7 @@ implementation
|
||||
scanner,
|
||||
pbase,pexpr,
|
||||
{ codegen }
|
||||
cgbase
|
||||
cgbase,procinfo
|
||||
;
|
||||
|
||||
|
||||
@ -508,12 +508,22 @@ implementation
|
||||
isarray:=is_dynamic_array(destppn.resultdef);
|
||||
if not((destppn.resultdef.typ=stringdef) or
|
||||
isarray) then
|
||||
begin
|
||||
CGMessage(type_e_mismatch);
|
||||
paras.free;
|
||||
exit;
|
||||
end;
|
||||
|
||||
begin
|
||||
{ possibly generic involved? }
|
||||
if df_generic in current_procinfo.procdef.defoptions then
|
||||
begin
|
||||
result.free;
|
||||
result:=internalstatements(newstatement);
|
||||
paras.free;
|
||||
exit;
|
||||
end
|
||||
else
|
||||
begin
|
||||
CGMessage(type_e_mismatch);
|
||||
paras.free;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
{ only dynamic arrays accept more dimensions }
|
||||
if (dims>1) then
|
||||
begin
|
||||
@ -584,7 +594,7 @@ implementation
|
||||
cordconstnode.create(getparaencoding(destppn.resultdef),u16inttype,true),
|
||||
paras
|
||||
)
|
||||
);
|
||||
);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
27
tests/webtbs/tw20557.pp
Normal file
27
tests/webtbs/tw20557.pp
Normal file
@ -0,0 +1,27 @@
|
||||
program generictest5;
|
||||
|
||||
{$mode delphi}{$H+}
|
||||
|
||||
type
|
||||
|
||||
TRec<T> = record
|
||||
Value : T;
|
||||
end;
|
||||
TRecArray<T> = array of TRec<T>;
|
||||
|
||||
{ TFoo }
|
||||
|
||||
TFoo<T> = class
|
||||
FArr : TRecArray<T>;
|
||||
procedure Test;
|
||||
end;
|
||||
|
||||
{ TFoo<T> }
|
||||
|
||||
procedure TFoo<T>.Test;
|
||||
begin
|
||||
SetLength(FArr, 1);
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user