* fix for Mantis #32108: ensure that types are registered once there is no more specialization is going on

git-svn-id: trunk@37341 -
This commit is contained in:
svenbarth 2017-09-27 20:47:16 +00:00
parent b765d661ce
commit a1c910d892
4 changed files with 50 additions and 0 deletions

2
.gitattributes vendored
View File

@ -15781,6 +15781,7 @@ tests/webtbs/tw31945.pp svneol=native#text/pascal
tests/webtbs/tw3197.pp svneol=native#text/plain
tests/webtbs/tw3207.pp svneol=native#text/plain
tests/webtbs/tw3210.pp svneol=native#text/plain
tests/webtbs/tw32108.pp svneol=native#text/pascal
tests/webtbs/tw32111.pp svneol=native#text/pascal
tests/webtbs/tw32118.pp svneol=native#text/pascal
tests/webtbs/tw3212.pp svneol=native#text/plain
@ -16435,6 +16436,7 @@ tests/webtbs/uw3179a.pp svneol=native#text/plain
tests/webtbs/uw3179b.pp svneol=native#text/plain
tests/webtbs/uw3184a.pp svneol=native#text/plain
tests/webtbs/uw3184b.pp svneol=native#text/plain
tests/webtbs/uw32108.pp svneol=native#text/pascal
tests/webtbs/uw3292a.pp svneol=native#text/plain
tests/webtbs/uw3340.pp svneol=native#text/plain
tests/webtbs/uw3353.pp svneol=native#text/plain

View File

@ -743,6 +743,10 @@ implementation
of the defs in the def list of the module}
ttypesym(sym).typedef:=hdef;
newtype.typedef:=hdef;
{ ensure that the type is registered when no specialization is
currently done }
if current_scanner.replay_stack_depth=0 then
hdef.register_def;
{ KAZ: handle TGUID declaration in system unit }
if (cs_compilesystem in current_settings.moduleswitches) and
assigned(hdef) and

10
tests/webtbs/tw32108.pp Normal file
View File

@ -0,0 +1,10 @@
program tw32108;
uses uw32108;
begin
if getTFooF <> 1 then
Halt(1);
Writeln('ok');
end.

34
tests/webtbs/uw32108.pp Normal file
View File

@ -0,0 +1,34 @@
unit uw32108;
{$mode delphi}
interface
function getTFooF: Integer;
implementation
type
{ TFoo }
TFoo = class
class var f: integer;
class constructor Create;
end;
{ TFoo }
class constructor TFoo.Create;
begin
f := 1;
end;
function getTFooF: Integer;
begin
Result := TFoo.f;
end;
begin
end.