mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 05:29:10 +02:00
Fix generation of class names for specializations.
symdef.pas, tstoreddef: * is_specialization: fix exit condition to correctly recognize specializations + added test git-svn-id: trunk@29328 -
This commit is contained in:
parent
a1ba11ff88
commit
5848637db3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11700,6 +11700,7 @@ tests/test/tgeneric93.pp svneol=native#text/pascal
|
||||
tests/test/tgeneric94.pp svneol=native#text/pascal
|
||||
tests/test/tgeneric95.pp svneol=native#text/pascal
|
||||
tests/test/tgeneric96.pp svneol=native#text/pascal
|
||||
tests/test/tgeneric97.pp svneol=native#text/pascal
|
||||
tests/test/tgoto.pp svneol=native#text/plain
|
||||
tests/test/theap.pp svneol=native#text/plain
|
||||
tests/test/theapthread.pp svneol=native#text/plain
|
||||
|
@ -2116,7 +2116,7 @@ implementation
|
||||
sym:=tsym(genericparas[i]);
|
||||
if sym.typ<>symconst.typesym then
|
||||
internalerror(2014050904);
|
||||
if sym.owner.defowner=self then
|
||||
if sym.owner.defowner<>self then
|
||||
exit(true);
|
||||
end;
|
||||
result:=false;
|
||||
|
18
tests/test/tgeneric97.pp
Normal file
18
tests/test/tgeneric97.pp
Normal file
@ -0,0 +1,18 @@
|
||||
program tgeneric97;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
generic TTest<T> = class
|
||||
|
||||
end;
|
||||
|
||||
TTestLongInt = specialize TTest<LongInt>;
|
||||
TTestString = specialize TTest<AnsiString>;
|
||||
|
||||
begin
|
||||
if LowerCase(TTestLongInt.ClassName) <> 'ttest<system.longint>' then
|
||||
halt(1);
|
||||
if LowerCase(TTestString.ClassName) <> 'ttest<system.ansistring>' then
|
||||
halt(2);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user