Cryptic error message for procedure bound to a type
Tobias Burnus
burnus@net-b.de
Wed Sep 8 14:51:00 GMT 2010
Hi Armelius,
On 09/08/2010 04:26 PM, Armelius Cameron wrote:
> I got the following error message that I don't understand:
>
> -----------
> procedure, private, pass ::&
> 1
> Error: Non-polymorphic passed-object dummy argument of 'initialize_mv'
> at (1)
The compiler is trying to tell you that your program violates the
following constraint:
C456 The passed-object dummy argument shall be a scalar, nonpointer,
nonallocatable dummy data object with the same declared type as the type
being de
ned; all of its length type parameters shall be assumed; it
shall be polymorphic (4.3.1.3) if and only if the type being de
ned is
extensible (4.5.7). It shall not have the VALUE attribute.
I would argue that your type "UnitValueForm" is extensible and that thus
the compiler is correct to reject:
subroutine Initialize_MV ( MV, Unit, Number )
type ( UnitValueForm ), intent ( inout ) ::&
MV
as "MX" is the passed-object dummy and it is not polymorphic, i.e. it is
not CLASS(UnitValueForm) but TYPE which is non-polymorphic.
> Below is the complete output and module file. This module can be
> compiled fine with the Cray's compiler. Thank you for any help.
That's a bug in the Cray compiler - the compiler is required* by the
standard to diagnose constraints.
Tobias
(* It might not diagnose by default as it might support this as vendor
extension, but there should be a flag such as "-std=f2008" to enable
standard-conforming checking.)
More information about the Fortran
mailing list