Incorrect "Could not resolve generic procedure" from nvfortran 25.11

The following code compiles correctly with gfortran and ifx, but fails with nvfortran 25.11

code.f90

MODULE m                                                                                                                               
                                                                                                                                       
   TYPE :: t                                                                                                                           
      PRIVATE                                                                                                                          
   CONTAINS                                                                                                                            
      PROCEDURE :: f1 => t_f1                                                                                                          
      PROCEDURE :: f2 => t_f2                                                                                                          
      GENERIC :: f => f1, f2                                                                                                           
   END TYPE                                                                                                                            
                                                                                                                                       
CONTAINS                                                                                                                               
                                                                                                                                       
   INTEGER FUNCTION f(i)                                                                                                               
      INTEGER :: i                                                                                                                     
      f = i                                                                                                                            
   END FUNCTION                                                                                                                        
                                                                                                                                       
   INTEGER FUNCTION t_f1(this, i, j)                                                                                                   
      CLASS(t) :: this                                                                                                                    
      INTEGER :: i, j                                                                                                                  
      t_f1 = i + j                                                                                                                     
   END FUNCTION                                                                                                                        
                                                                                                                                       
   INTEGER FUNCTION t_f2(this, i, j, k)                                                                                                
      CLASS(t) :: this                                                                                                                    
      INTEGER :: i, j, k                                                                                                               
      t_f2 = i + j + k                                                                                                                 
   END FUNCTION                                                                                                                        
                                                                                                                                       
   SUBROUTINE s                                                                                                                        
      PRINT*,f(1)                                                                                                                      
   END SUBROUTINE                                                                                                                      
END MODULE m
> nvfortran -c code.f90
NVFORTRAN-S-0155-Could not resolve generic procedure f (code.f90: 28)
  0 inform,   0 warnings,   1 severes, 0 fatal for s

f is not a generic prodedure in that module. Only the type-bound procudure t%f is generic. I can work around the bug by renaming f.

Thanks for the report Andrew. I filed this as TPR#38102 and sent it to engineering.

Note that the error does not occur with our new upcoming LLVM based nvfortran so I’m not 100% sure they’ll fix this in the current nvfortran, but might.

-Mat

1 Like

Hi Andrew,

FYI, TPR #38102 was fixed in our 26.1 release.

Thanks again for the report!
Mat