Hi,
nvfortran (22.11-0 64-bit) gives error NVFORTRAN-S-0155-Passed object dummy argument 'this' in type bound procedure 'get_val' of type 'typ_test' must be declared with data type 'typ_test' (main.f90: 26)
for the following minimal example.
MODULE mod_test
IMPLICIT NONE
PRIVATE
TYPE, PUBLIC :: typ_test(k)
INTEGER, KIND :: k
REAL(KIND = k) :: val
CONTAINS
PROCEDURE, PASS(this), PRIVATE :: get_val
GENERIC , PUBLIC :: get => get_val
END TYPE typ_test
CONTAINS
PURE FUNCTION get_val(this) RESULT(val)
IMPLICIT NONE
CLASS(typ_test(8)), INTENT(IN) :: this
REAL(kind=8) :: val
val = this%val
END FUNCTION get_val
END MODULE mod_test
PROGRAM prg_test
USE mod_test
IMPLICIT NONE
END PROGRAM prg_test
I am not sure if “generic” is supported by the compiler or if it is possibly a bug.
Thanks
Ali