Intel® Fortran Compiler

Developer Guide and Reference

ID 767251
Date 3/31/2025
Public
Document Table of Contents

SAME_TYPE_AS

Inquiry Intrinsic Function (Generic): Inquires whether the dynamic type of one object is the same as the dynamic type of another object.

result = SAME_TYPE_AS (a, b)

a

(Input) Is an object of extensible type. If it is a polymorphic pointer, it must not have an undefined association status.

b

(Input) Is an object of extensible type. If it is a polymorphic pointer, it must not have an undefined association status.

Results

The result type is default logical scalar. The result is true only if the dynamic type of a is the same as the dynamic type of b. The test for SAME_TYPE_AS does not take kind type parameters into consideration, while the test for the TYPE is construct does. A pointer that is disassociated, or an unallocated allocatable has the dynamic type of its declared type. Unlimited polymorphic entities have no declared type. When neither a or b are extensible types, the result is processor dependent.