fpc/tests/test/toperator87.pp
svenbarth 360592d1f4 Some corrections after the loosening of operator overloads:
* check "A op B" and "B op A" again for operators that can be commutative (all binary ones except shl, shr, div, mod, **, / and -)
* also check for Nil for classrefdefs if left side is a pointer (allows "TClass var" <>/= Nil again, after the above changes)
* don't allow overloads for "implicit pointer type <>/= pointer" and the other way around (this fixes non compiling Objective Pascal test tobjc21.pp and also the new toperator87.pp test)
* some formating corrections

+ added test for "TObject <> Pointer"
+ added test for "TClass <>/= Nil"

git-svn-id: trunk@21983 -
2012-07-29 12:38:09 +00:00

17 lines
161 B
ObjectPascal

{ %NORUN }
program toperator87;
{$mode delphi}
var
p: Pointer;
o: TObject;
b: Boolean;
begin
p := Nil;
o := Nil;
b := p <> o;
b := o <> p;
end.