SAME_TYPE_AS intrinsic function
Standard: F77 F90 F95 F2003 F2008
 Example Program
<Syntax>
SAME_TYPE_AS ( A, B )
A : object of extensible type or CLASS(*);
B : object of extensible type or CLASS(*);

Result : Default Logical scalar.

Both A and B are permitted to be unallocated allocatables or disassociated pointers, but are not permitted to be undefined pointers.
<Semantics>

The result is true if and only if the dynamic type of A is the same as the dynamic type of B. Note that the dynamic type of unallocated allocatable or disassociated pointer is the same as its declared type; in the case of CLASS(*), there is no declared type. Either A or B is CLASS(*) and has a dynamic type that is not extensible, the result is processor dependent.

Note that simply knowing that a type is the same as another does not give you access to any of the extended components; to do this you need to use the SELECT TYPE construct.

<Related>
CLASS specifier, Derived Type Definition EXTENDS clause, EXTENDS_TYPE_OF intrinsic function, SELECT TYPE construct