mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 21:28:03 +02:00
* don't allow generics as parent classes
git-svn-id: trunk@8144 -
This commit is contained in:
parent
8bd95f4dd4
commit
ad4846a50e
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
13
tests/webtbf/tw8591.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ %fail }
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
generic TG1<T> = class
|
||||
end;
|
||||
|
||||
generic TG2<T> = class(TG1)
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user