Hi there,
The attached code fails to compile with the following:
[sfilippo@euler TNV]$ nvfortran --version
nvfortran 24.3-0 64-bit target on x86-64 Linux -tp alderlake
NVIDIA Compilers and Tools
Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
[sfilippo@euler TNV]$ nvfortran -c test.f90
NVFORTRAN-S-0155-PASS argument is incompatible with parent's PASS argument in type bound procedure x_zzz_get_nz_row (test.f90: 70)
NVFORTRAN-S-0155-Dummy argument names must be the same as those in parent's interface for type bound procedure x_zzz_get_nz_row (test.f90: 70)
NVFORTRAN-S-0155-Interface is not compatible with parent's interface for type bound procedure x_zzz_get_nz_row (test.f90: 70)
NVFORTRAN/x86-64 Linux 24.3-0: compilation completed with severe errors
The code (reduced and extracted from a much more complex source) compiles fine with many other compilers, including GNU, FLANG, Intel and others.
Is this a code issue or an nvfortran problem?
Thanks
Salvatore
module base_mod
use iso_fortran_env
integer, parameter :: ipk_ = int32
integer, parameter :: lpk_ = int64
type :: base
contains
procedure, pass(a) :: get_nz_row => base_get_nz_row
end type base
interface
module function base_get_nz_row(idx,a) result(res)
integer(ipk_), intent(in) :: idx
class(base), intent(in) :: a
integer(ipk_) :: res
end function base_get_nz_row
end interface
end module base_mod
module x_base_mod
use base_mod
type, extends(base) :: x_base
end type x_base
type, extends(x_base) :: x_yyy
contains
procedure, pass(a) :: get_nz_row => x_yyy_get_nz_row
end type x_yyy
interface
function x_yyy_get_nz_row(idx,a) result(res)
import
class(x_yyy), intent(in) :: a
integer(ipk_), intent(in) :: idx
integer(ipk_) :: res
end function x_yyy_get_nz_row
end interface
end module x_base_mod
module x_zzz_mod
use x_base_mod
type, extends(x_base) :: x_zzz
contains
procedure, pass(a) :: get_nz_row => x_zzz_get_nz_row
end type x_zzz
private :: x_zzz_get_nz_row
contains
function x_zzz_get_nz_row(idx,a) result(res)
implicit none
class(x_zzz), intent(in) :: a
integer(ipk_), intent(in) :: idx
integer(ipk_) :: res
res = 0
end function x_zzz_get_nz_row
end module x_zzz_mod