In reply to acpatel5:
There’s a difference between the types of the class variables versus the types of the class objects contained by the variables.
class A;
endclass
class B extends A;
endclass
A a1=new, a2;
B b1=new, b2;
Then if you have
$cast(b2,a2);
That satisfies the part before the and. But if the statement before it was a2=a2;, the object handle contained in a2 is not assignment compatible with b1, so it would fail.