mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:29:29 +02:00
* nil =/<> dyn. array is a valid expression, so isbinaryoperatoroverloadable needs to take care of it, resolves #39933
(cherry picked from commit 2396b36c21
)
This commit is contained in:
parent
28865ab4f8
commit
19c2e948b9
@ -459,7 +459,8 @@ implementation
|
||||
) or
|
||||
(
|
||||
(lt=niln) and
|
||||
(rd.typ in [procvardef,procdef,classrefdef]) and
|
||||
((rd.typ in [procvardef,procdef,classrefdef]) or
|
||||
(is_dynamic_array(rd))) and
|
||||
(treetyp in identity_operators)
|
||||
) or
|
||||
(
|
||||
|
13
tests/webtbs/tw39933.pp
Normal file
13
tests/webtbs/tw39933.pp
Normal file
@ -0,0 +1,13 @@
|
||||
{ %norun }
|
||||
program Project1;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
var a: TArray<integer>;
|
||||
|
||||
begin
|
||||
writeln ( a = nil );
|
||||
writeln ( a <> nil );
|
||||
writeln ( nil = a ); // project1.lpr(10,17) Error: Operator is not overloaded: "Pointer" = "TArray$1$crc9F312717"
|
||||
writeln ( nil <> a ); // project1.lpr(11,17) Error: Operator is not overloaded: "Pointer" = "TArray$1$crc9F312717"
|
||||
end.
|
Loading…
Reference in New Issue
Block a user