* accept undefineddef (generic parameter) as parameter for assigned, resolves #19974

git-svn-id: trunk@18183 -
This commit is contained in:
florian 2011-08-12 20:33:22 +00:00
parent 5d59d00fdc
commit 8b58d69576
3 changed files with 32 additions and 4 deletions

1
.gitattributes vendored
View File

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

View File

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