* don't allow generics as parent classes

git-svn-id: trunk@8144 -
This commit is contained in:
peter 2007-07-22 23:10:24 +00:00
parent 8bd95f4dd4
commit ad4846a50e
3 changed files with 22 additions and 0 deletions

1
.gitattributes vendored
View File

@ -7391,6 +7391,7 @@ tests/webtbf/tw8465a.pp svneol=native#text/plain
tests/webtbf/tw8528.pp svneol=native#text/plain
tests/webtbf/tw8583.pp svneol=native#text/plain
tests/webtbf/tw8588.pp svneol=native#text/plain
tests/webtbf/tw8591.pp -text
tests/webtbf/tw8738.pas svneol=native#text/plain
tests/webtbf/tw8777a.pp svneol=native#text/plain
tests/webtbf/tw8777b.pp svneol=native#text/plain

View File

@ -439,6 +439,14 @@ implementation
hasparentdefined:=true;
end;
{ no generic as parents }
if assigned(childof) and
(df_generic in childof.defoptions) then
begin
Message(parser_e_no_generics_as_types);
childof:=nil;
end;
{ if no parent class, then a class get tobject as parent }
if not assigned(childof) then
begin

13
tests/webtbf/tw8591.pp Normal file
View File

@ -0,0 +1,13 @@
{ %fail }
{$mode objfpc}
type
generic TG1<T> = class
end;
generic TG2<T> = class(TG1)
end;
begin
end.