mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-01 23:09:32 +01:00
* fix for Mantis #30626: unset current_procinfo so that further specializations don't use a symtable to specialize themselves in that they shouldn't use (cause current_procinfo takes precedence)
git-svn-id: trunk@34916 -
This commit is contained in:
parent
0e7a9ad375
commit
63b0024e4c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -15245,6 +15245,7 @@ tests/webtbs/tw30537.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30552.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw30570.pp svneol=native#text/plain
|
||||
tests/webtbs/tw30572.pp svneol=native#text/plain
|
||||
tests/webtbs/tw30626.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3063.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3064.pp svneol=native#text/plain
|
||||
tests/webtbs/tw30666.pp svneol=native#text/plain
|
||||
|
||||
@ -713,6 +713,7 @@ uses
|
||||
old_current_structdef : tabstractrecorddef;
|
||||
old_current_specializedef,
|
||||
old_current_genericdef : tstoreddef;
|
||||
old_current_procinfo : tprocinfo;
|
||||
hmodule : tmodule;
|
||||
oldcurrent_filepos : tfileposinfo;
|
||||
recordbuf : tdynamicarray;
|
||||
@ -908,6 +909,9 @@ uses
|
||||
old_current_specializedef:=nil;
|
||||
old_current_genericdef:=nil;
|
||||
old_current_structdef:=nil;
|
||||
old_current_procinfo:=current_procinfo;
|
||||
|
||||
current_procinfo:=nil;
|
||||
|
||||
if parse_class_parent then
|
||||
begin
|
||||
@ -1082,6 +1086,7 @@ uses
|
||||
end;
|
||||
|
||||
block_type:=old_block_type;
|
||||
current_procinfo:=old_current_procinfo;
|
||||
if parse_class_parent then
|
||||
begin
|
||||
current_structdef:=old_current_structdef;
|
||||
|
||||
35
tests/webtbs/tw30626.pp
Normal file
35
tests/webtbs/tw30626.pp
Normal file
@ -0,0 +1,35 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw30626;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
generic IBase<T> = interface(IUnknown)
|
||||
end;
|
||||
|
||||
generic TBase<T> = class(TInterfacedObject, specialize IBase<T>)
|
||||
public
|
||||
function Test: specialize IBase<T>;
|
||||
end;
|
||||
|
||||
generic TDerived<T> = class(specialize TBase<T>)
|
||||
|
||||
end;
|
||||
|
||||
function TBase.Test: specialize IBase<T>;
|
||||
begin
|
||||
result := (specialize TDerived<T>).Create;
|
||||
end;
|
||||
|
||||
type
|
||||
TIntDerived = specialize TDerived<Integer>;
|
||||
|
||||
var
|
||||
t: TIntDerived;
|
||||
|
||||
begin
|
||||
t := TIntDerived.Create;
|
||||
t.Test;
|
||||
end.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user