fpc/tests/test/toperator88.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

14 lines
153 B
ObjectPascal

{ %NORUN }
program toperator88;
var
c: TClass;
b: Boolean;
begin
c := Nil;
b := c = Nil;
b := c <> Nil;
b := Nil = c;
b := Nil <> c;
end.