Quantcast
Channel: Intel® Fortran Composer XE
Viewing all articles
Browse latest Browse all 1424

Parameterized derived types with PASS

$
0
0

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.   [K]

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

Thanks.

 


Viewing all articles
Browse latest Browse all 1424

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>