Reference Type-bound Procedure Implemented in an Abstract Type with Intel® Fortran Compiler


Problem : 
Reference a type-bound procedure(Proc1) implemented within an abstract type(Abs1) through a parent component of the extended non-abstract type object(C), e.g. "call C%Abs1%Proc1", you may encounter following compile time error:
   
error #8307: If the rightmost part-name is of abstract type, data-ref shall be polymorphic 

Environment : 
Intel® Fortran Compiler 11.1 above for Windows or Linux

Root Cause : 
An abstract type can only be referenced by a polymorphic object, although a type-bound procedure is implemented within it. It's just like the C++ abstract class which cannot get instantiated, an abstract type in Fortran also cannot be declared with TYPE specifier as a non-polymorphic, specific data object. A parent type component will keep the type and type parameters of the parent type. When the parent type is an abstract type, it cannot get referenced as a component of a non-abstract entended type object. 

Resolution : 
An extended type includes all of the type parameters, all of the components, and the nonoverridden nonfinal procedure bindings of its parent type. For the type-bound procedures defined in an abstract type, make it nonoverridden to reference it as a component of the extended type instead, or add a deffered binding to it so that we can avoid to directly reference it or through the abstract parent component.
For more complete information about compiler optimizations, see our Optimization Notice.