CLASS IS statement

Standard: F77 F90 F95 F2003 F2008 F2018


<Syntax>

CLASS IS (type-specifier) [ construct-name ]

The type-specifier must specify an extensible type. If the type has length type parameters, they must be assumed (specified as “*”).

This statement is part of the SELECT TYPE construct. The construct-name must appear if and only if the SELECT TYPE statement is named, and must be the same.

<Semantics>

The CLASS IS statement marks the beginning of a CLASS IS block in a SELECT TYPE construct. This block is executed if the dynamic type of the selector is the same as, or an extension of, the named derived type, and if it is the most specific condition which is satisfied. That is, it is not executed if the dynamic type matches one of the TYPE IS blocks, or matches a CLASS IS block which specifies a type that is an extension of this block's type.

Within a CLASS IS block, the associate-name of the SELECT TYPE statement is polymorphic, and has the declared type of type-name.

<Related>

CLASS specifier, CLASS DEFAULT statement, SELECT TYPE construct, TYPE statement, TYPE IS statement