| April 15, 2010 12:00 AM PDT | |
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:
Environment :
Intel(R) 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.
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(R) 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.
Do you need more help?
This article applies to: Intel Software Network communities, Intel® Fortran Compiler for Linux* Knowledge Base, Intel® Fortran Compiler for Mac OS X* Knowledge Base, Intel® Visual Fortran Compiler for Windows* Knowledge Base
For more complete information about compiler optimizations, see our Optimization Notice.
Comments (0) 
Trackbacks (0)
Leave a comment 
To obtain technical support, please go to Software Support.

