* sets with the same base/range can still have a different size (and hence

not be equal) due to different packset settings -> still need conversion
    (mantis #23204)

git-svn-id: trunk@23054 -
This commit is contained in:
Jonas Maebe 2012-11-24 12:32:57 +00:00
parent 8535da3e99
commit c7255f153e
4 changed files with 46 additions and 3 deletions

2
.gitattributes vendored
View File

@ -12999,6 +12999,7 @@ tests/webtbs/tw2317.pp svneol=native#text/plain
tests/webtbs/tw2318.pp svneol=native#text/plain
tests/webtbs/tw23185.pp svneol=native#text/pascal
tests/webtbs/tw2318b.pp svneol=native#text/plain
tests/webtbs/tw23204.pp -text svneol=native#text/plain
tests/webtbs/tw23212.pp svneol=native#text/plain
tests/webtbs/tw2323.pp svneol=native#text/plain
tests/webtbs/tw23270.pp svneol=native#text/pascal
@ -13789,6 +13790,7 @@ tests/webtbs/uw2266b.pas svneol=native#text/plain
tests/webtbs/uw2269.inc svneol=native#text/plain
tests/webtbs/uw22741a.pp svneol=native#text/plain
tests/webtbs/uw22741b.pp svneol=native#text/plain
tests/webtbs/uw23204.pp -text svneol=native#text/plain
tests/webtbs/uw2364.pp svneol=native#text/plain
tests/webtbs/uw2706a.pp svneol=native#text/plain
tests/webtbs/uw2706b.pp svneol=native#text/plain

View File

@ -1376,10 +1376,12 @@ implementation
if assigned(tsetdef(def_from).elementdef) and
assigned(tsetdef(def_to).elementdef) then
begin
{ sets with the same element base type and the same range are equal }
{ sets with the same size (packset setting), element
base type and the same range are equal }
if equal_defs(tsetdef(def_from).elementdef,tsetdef(def_to).elementdef) and
(tsetdef(def_from).setbase=tsetdef(def_to).setbase) and
(tsetdef(def_from).setmax=tsetdef(def_to).setmax) then
(tsetdef(def_from).setbase=tsetdef(def_to).setbase) and
(tsetdef(def_from).setmax=tsetdef(def_to).setmax) and
(def_from.size=def_to.size) then
eq:=te_equal
else if is_subequal(tsetdef(def_from).elementdef,tsetdef(def_to).elementdef) then
begin

21
tests/webtbs/tw23204.pp Normal file
View File

@ -0,0 +1,21 @@
program tw23204;
{$mode Delphi}{$H+}
uses
uw23204;
var
cur_p: TP;
function DropP:TPs;
begin
result := [cur_p.AType];
end;
begin
cur_p.AType:=pt_1;
if DropP<>[pt_1] then
halt(1);
end.

18
tests/webtbs/uw23204.pp Normal file
View File

@ -0,0 +1,18 @@
unit uw23204;
//{$mode Delphi}{$H+} // error disappears!
{$mode objfpc}{$H+}
interface
type
// TPColor = (pc1, pc2);
TPType = (pt_0, pt_1);
TP = record
// AColor: TPColor;
AType: TPType;
end;
TPs = set of TPType;
implementation
end.