From daa002f26b2736085d0870c5d0a28c1b93ada11d Mon Sep 17 00:00:00 2001 From: peter Date: Tue, 18 Oct 2005 07:22:55 +0000 Subject: [PATCH] * only check forwards for the original object type declaration git-svn-id: trunk@1459 - --- .gitattributes | 6 ++++++ compiler/symtable.pas | 4 +++- tests/webtbs/tw4352.pp | 13 +++++++++++++ tests/webtbs/uw4352a.pp | 18 ++++++++++++++++++ tests/webtbs/uw4352b.pp | 15 +++++++++++++++ tests/webtbs/uw4352c.pp | 16 ++++++++++++++++ tests/webtbs/uw4352d.pp | 25 +++++++++++++++++++++++++ tests/webtbs/uw4352e.pp | 11 +++++++++++ 8 files changed, 107 insertions(+), 1 deletion(-) create mode 100755 tests/webtbs/tw4352.pp create mode 100755 tests/webtbs/uw4352a.pp create mode 100755 tests/webtbs/uw4352b.pp create mode 100755 tests/webtbs/uw4352c.pp create mode 100755 tests/webtbs/uw4352d.pp create mode 100755 tests/webtbs/uw4352e.pp diff --git a/.gitattributes b/.gitattributes index 0895ad6aa2..6dd406beee 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6317,6 +6317,7 @@ tests/webtbs/tw4294.pp svneol=native#text/plain tests/webtbs/tw4308.pp svneol=native#text/plain tests/webtbs/tw4336.pp svneol=native#text/plain tests/webtbs/tw4350.pp svneol=native#text/plain +tests/webtbs/tw4352.pp svneol=native#text/plain tests/webtbs/tw4388.pp svneol=native#text/plain tests/webtbs/tw4390.pp svneol=native#text/plain tests/webtbs/tw4398.pp svneol=native#text/plain @@ -6360,6 +6361,11 @@ tests/webtbs/uw3474b.pp svneol=native#text/plain tests/webtbs/uw3964.pp -text tests/webtbs/uw3968.pp svneol=native#text/plain tests/webtbs/uw4140.pp svneol=native#text/plain +tests/webtbs/uw4352a.pp svneol=native#text/plain +tests/webtbs/uw4352b.pp svneol=native#text/plain +tests/webtbs/uw4352c.pp svneol=native#text/plain +tests/webtbs/uw4352d.pp svneol=native#text/plain +tests/webtbs/uw4352e.pp svneol=native#text/plain utils/Makefile svneol=native#text/plain utils/Makefile.fpc svneol=native#text/plain utils/README -text diff --git a/compiler/symtable.pas b/compiler/symtable.pas index cad1e7c891..dbcf57f57a 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -692,10 +692,12 @@ implementation tprocsym(sym).check_forward { check also object method table } { we needn't to test the def list } - { because each object has to have a type sym } + { because each object has to have a type sym, + only test objects declarations, not type renamings } else if (tsym(sym).typ=typesym) and assigned(ttypesym(sym).restype.def) and + (ttypesym(sym).restype.def.typesym=ttypesym(sym)) and (ttypesym(sym).restype.def.deftype=objectdef) then tobjectdef(ttypesym(sym).restype.def).check_forwards; end; diff --git a/tests/webtbs/tw4352.pp b/tests/webtbs/tw4352.pp new file mode 100755 index 0000000000..c1b5c2b631 --- /dev/null +++ b/tests/webtbs/tw4352.pp @@ -0,0 +1,13 @@ +{$mode delphi} +unit tw4352; + +interface + +uses + SysUtils, uw4352d; + +type Sys = TIdSysWin32; // commenting this helps too + +implementation + +end. diff --git a/tests/webtbs/uw4352a.pp b/tests/webtbs/uw4352a.pp new file mode 100755 index 0000000000..ad58311a75 --- /dev/null +++ b/tests/webtbs/uw4352a.pp @@ -0,0 +1,18 @@ +{$mode delphi} +unit uw4352a; + +interface + +uses + uw4352c, + SysUtils; + +type + TIdSysVCL = class(TIdSysBase) + public + + end; + +implementation + +end. diff --git a/tests/webtbs/uw4352b.pp b/tests/webtbs/uw4352b.pp new file mode 100755 index 0000000000..191a245709 --- /dev/null +++ b/tests/webtbs/uw4352b.pp @@ -0,0 +1,15 @@ +{$mode delphi} +unit uw4352b; + +interface + +uses uw4352a, SysUtils; + +type + + TIdSysNativeVCL = class(TIdSysVCL) + public + end; + +implementation +end. diff --git a/tests/webtbs/uw4352c.pp b/tests/webtbs/uw4352c.pp new file mode 100755 index 0000000000..cc775d9bf2 --- /dev/null +++ b/tests/webtbs/uw4352c.pp @@ -0,0 +1,16 @@ +{ Source provided for Free Pascal Bug Report 4352 } +{ Submitted by "marco" on 2005-09-08 } +{ e-mail: } +{$mode delphi} +unit uw4352c; + +interface + + +type + TIdSysBase = class + end; + +implementation + +end. diff --git a/tests/webtbs/uw4352d.pp b/tests/webtbs/uw4352d.pp new file mode 100755 index 0000000000..946fb84a23 --- /dev/null +++ b/tests/webtbs/uw4352d.pp @@ -0,0 +1,25 @@ +{$mode delphi} +unit uw4352d; + +interface + +uses + uw4352b, SysUtils; + +type + TIdSysWin32 = class(TIdSysNativeVCL) + public + class function Win32MajorVersion : Integer; + end; + + +implementation + +uses uw4352e; // commenting this helps. + +class function TIdSysWin32.Win32MajorVersion: Integer; +begin + Result := 100; +end; + +end. diff --git a/tests/webtbs/uw4352e.pp b/tests/webtbs/uw4352e.pp new file mode 100755 index 0000000000..96b20d5cb9 --- /dev/null +++ b/tests/webtbs/uw4352e.pp @@ -0,0 +1,11 @@ +{$mode delphi} +unit uw4352e; + +interface + +uses + tw4352; + +implementation + +end.