* fully compare typenodes and rttinodes in their docompare() methods

(mantis #21551)

git-svn-id: trunk@20630 -
This commit is contained in:
Jonas Maebe 2012-03-25 16:52:34 +00:00
parent bd19a16be9
commit 26754a3f9f
3 changed files with 26 additions and 2 deletions

1
.gitattributes vendored
View File

@ -12297,6 +12297,7 @@ tests/webtbs/tw2131.pp svneol=native#text/plain
tests/webtbs/tw21443.pp svneol=native#text/plain
tests/webtbs/tw2145.pp svneol=native#text/plain
tests/webtbs/tw21472.pp svneol=native#text/pascal
tests/webtbs/tw21551.pp svneol=native#text/plain
tests/webtbs/tw2158.pp svneol=native#text/plain
tests/webtbs/tw2159.pp svneol=native#text/plain
tests/webtbs/tw2163.pp svneol=native#text/plain

View File

@ -1185,7 +1185,10 @@ implementation
function ttypenode.docompare(p: tnode): boolean;
begin
docompare :=
inherited docompare(p);
inherited docompare(p) and
(typedef=ttypenode(p).typedef) and
(allowed=ttypenode(p).allowed) and
(helperallowed=ttypenode(p).helperallowed);
end;
@ -1267,7 +1270,8 @@ implementation
docompare :=
inherited docompare(p) and
(rttidef = trttinode(p).rttidef) and
(rttitype = trttinode(p).rttitype);
(rttitype = trttinode(p).rttitype) and
(rttidatatype = trttinode(p).rttidatatype);
end;
end.

19
tests/webtbs/tw21551.pp Normal file
View File

@ -0,0 +1,19 @@
{ %opt=-O2 }
{$mode delphi}
type
tc1 = class
end;
tc2 = class
end;
var
c: tobject;
begin
c:=tc2.create;
if (c is tc1) or
(c is tc2) then
halt(0);
halt(1);
end.