Browse Source

* only check forwards for the original object type declaration

git-svn-id: trunk@1459 -
peter 20 years ago
parent
commit
daa002f26b

+ 6 - 0
.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

+ 3 - 1
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;

+ 13 - 0
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.

+ 18 - 0
tests/webtbs/uw4352a.pp

@@ -0,0 +1,18 @@
+{$mode delphi}
+unit uw4352a;
+
+interface
+
+uses
+  uw4352c,
+  SysUtils;
+
+type
+  TIdSysVCL = class(TIdSysBase)
+  public
+
+  end;
+
+implementation
+
+end.

+ 15 - 0
tests/webtbs/uw4352b.pp

@@ -0,0 +1,15 @@
+{$mode delphi}
+unit uw4352b;
+
+interface
+
+uses uw4352a, SysUtils;
+
+type
+
+  TIdSysNativeVCL = class(TIdSysVCL)
+  public
+  end;
+
+implementation
+end.

+ 16 - 0
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.

+ 25 - 0
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.

+ 11 - 0
tests/webtbs/uw4352e.pp

@@ -0,0 +1,11 @@
+{$mode delphi}
+unit uw4352e;
+
+interface
+
+uses
+  tw4352;
+
+implementation
+
+end.