I think this module is conforming:
module m
type :: t( l )
integer, len :: l=30
contains
procedure :: s
end type t
contains
subroutine s( a )
class( t ) :: a
end subroutine s
end module m
One compiler rejects it with:
All length type parameters of the passed object dummy argument must be assumed. [A]
subroutine s( a )
----------------^
Indeed I can change
class( t ) :: a
to
class( t( l=*) ) :: a
and this makes the compiler happy,
but I think this is unnecessary given
that type t gives length parameter l
a default value.
Also, if I remove a type-bound procedure:
module m
type :: t( l )
integer, len :: l=30
! contains
! procedure :: s
end type t
contains
subroutine s( a )
class( t ) :: a
end subroutine s
end module m
then this is acceptable to the compiler too.
Am I wrong?
Are there different rules
for dummy arguments of derived types with
length type parameters, for type-bound and
non type-bound procedures?
Anton
|