Fix for Mantis #26482.

pgenutil.pas, generate_specialization:
  * also search for the generic type in general if it was previously found in a record/class as there might be a non-generic type (or one with a different number of parameters) defined elsewhere

+ added test

git-svn-id: trunk@28244 -
This commit is contained in:
svenbarth 2014-07-20 15:47:18 +00:00
parent f0f628798b
commit 856ae9d3cf
3 changed files with 28 additions and 0 deletions

1
.gitattributes vendored
View File

@ -14000,6 +14000,7 @@ tests/webtbs/tw26408.pp svneol=native#text/pascal
tests/webtbs/tw2643.pp svneol=native#text/plain
tests/webtbs/tw2645.pp svneol=native#text/plain
tests/webtbs/tw2647.pp svneol=native#text/plain
tests/webtbs/tw26482.pp svneol=native#text/pascal
tests/webtbs/tw2649.pp svneol=native#text/plain
tests/webtbs/tw2651.pp svneol=native#text/plain
tests/webtbs/tw2656.pp svneol=native#text/plain

View File

@ -590,6 +590,8 @@ uses
found:=searchsym_in_class(tobjectdef(genericdef.owner.defowner),tobjectdef(genericdef.owner.defowner),ugenname,srsym,st,[])
else
found:=searchsym_in_record(tabstractrecorddef(genericdef.owner.defowner),ugenname,srsym,st);
if not found then
found:=searchsym(ugenname,srsym,st);
end
else
found:=searchsym(ugenname,srsym,st);

25
tests/webtbs/tw26482.pp Normal file
View File

@ -0,0 +1,25 @@
unit tw26482;
{$mode delphi}
interface
type
TEnumerator<T> = class
end;
TList<T> = class
public
type
TEnumerator = class(TObject);
protected
function DoGetEnumerator: TEnumerator<T>;
end;
implementation
function TList<T>.DoGetEnumerator: TEnumerator<T>; // Error: Identifier not found "TEnumerator$1"
begin
end;
end.