mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-16 00:30:44 +01:00
* accept undefineddef (generic parameter) as parameter for assigned, resolves #19974
git-svn-id: trunk@18183 -
This commit is contained in:
parent
5d59d00fdc
commit
8b58d69576
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11719,6 +11719,7 @@ tests/webtbs/tw1964.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19700.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19864.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw1996.pp svneol=native#text/plain
|
||||
tests/webtbs/tw19974.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2001.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2002.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2004.pp svneol=native#text/plain
|
||||
|
||||
@ -515,10 +515,11 @@ implementation
|
||||
err:=true;
|
||||
end;
|
||||
else
|
||||
begin
|
||||
Message(parser_e_illegal_parameter_list);
|
||||
err:=true;
|
||||
end;
|
||||
if p1.resultdef.typ<>undefineddef then
|
||||
begin
|
||||
Message(parser_e_illegal_parameter_list);
|
||||
err:=true;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
||||
26
tests/webtbs/tw19974.pp
Normal file
26
tests/webtbs/tw19974.pp
Normal file
@ -0,0 +1,26 @@
|
||||
program uGenAss;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
|
||||
type
|
||||
generic TGeneric<T> = class
|
||||
public
|
||||
function Find(AObject: T): T;
|
||||
end;
|
||||
|
||||
function TGeneric.Find(AObject: T): T;
|
||||
var
|
||||
tt: T;
|
||||
begin
|
||||
if tt <> nil then;
|
||||
if AObject <> nil then;
|
||||
|
||||
if Assigned(tt) then;
|
||||
if Assigned(AObject) then;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user