* patch by Bart Broersma to allow to declare "LongInt = AnsiString" comparison

operator in non-macpas modes, resolves #29460

git-svn-id: trunk@43709 -
This commit is contained in:
florian 2019-12-22 22:06:26 +00:00
parent b8b5d84108
commit 2f374a37b7
3 changed files with 20 additions and 0 deletions

1
.gitattributes vendored
View File

@ -17515,6 +17515,7 @@ tests/webtbs/tw2943.pp svneol=native#text/plain
tests/webtbs/tw2944.pp svneol=native#text/plain
tests/webtbs/tw29444.pp svneol=native#text/pascal
tests/webtbs/tw2946.pp svneol=native#text/plain
tests/webtbs/tw29460.pp svneol=native#text/pascal
tests/webtbs/tw29471.pp svneol=native#text/plain
tests/webtbs/tw2949.pp svneol=native#text/plain
tests/webtbs/tw29491.pp svneol=native#text/plain

View File

@ -333,6 +333,7 @@ implementation
(treetyp in order_theoretic_operators)
) or
(
(m_mac in current_settings.modeswitches) and
is_stringlike(rd) and
(ld.typ=orddef) and
(treetyp in string_comparison_operators)) or

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

@ -0,0 +1,18 @@
program project1;
{$mode objfpc}{$H+}
{$modeswitch advancedrecords}
operator = (z1: LongInt; z2 : ansistring) b : boolean;
begin
b := false;
end;
var
i: longint;
s: string;
begin
if i = s then
halt(1);
writeln('ok');
end.