Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29487 Discussions

Parameterized derived types with PASS

Simon_Geard
New Contributor I
925 Views

I'm trying to use parameterized derived types and have run into a problem which I have distilled into the following code:

module t_mod

    implicit none
    
    type T(k)
        integer, kind   :: k = 4
        integer(kind=k) :: d
    contains
        procedure, public, pass(x) :: check_v
    end type T

    contains
  
    logical function check_v(k, x)
        integer  :: k
        class(T) :: x
        check_v = (k == x%d)
    end function check_v

end module t_mod

I get the following compilation error:

error #8262: For a type-bound procedure that has the PASS binding attribute, the first dummy argument must have the same declared type as the type being defined.  

How should I declare k in order for this to compile ?

Thanks.

 

0 Kudos
2 Replies
Steven_L_Intel1
Employee
925 Views

This is a bug that will be fixed in version 16. It's not fixed in the current beta but should be in the first beta update.

0 Kudos
Simon_Geard
New Contributor I
925 Views

Thanks. I was using the current v16 beta so I'll wait for the update.

0 Kudos
Reply