# Could not resolve generic procedure

**URL:** <https://forums.developer.nvidia.com/t/could-not-resolve-generic-procedure/134331>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [December 8, 2014, 4:37pm UTC](https://forums.developer.nvidia.com/t/could-not-resolve-generic-procedure/134331 "2014-12-08T16:37:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_Navaro](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Pierre\_Navaro](https://forums.developer.nvidia.com/u/Pierre_Navaro)\
**Post date:** [December 8, 2014, 4:37pm UTC](https://forums.developer.nvidia.com/t/could-not-resolve-generic-procedure/134331/1 "2014-12-08T16:37:53Z")

</div>

The PGI fortran compiler raises an error when we use a interface inside an implementation of an abstract type. I don’t think i break the norm but i am not sure.

I made a simple example :

The abstract type :

```plaintext
module example_abstract

type, abstract :: foo_parent
contains
  procedure(integer_interface), pass, deferred :: add_integer
  procedure(real_interface), pass, deferred :: add_real
end type foo_parent

abstract interface
  subroutine integer_interface(this,x)
    import foo_parent
    class(foo_parent) :: this
    integer :: x
   end subroutine
end interface

abstract interface
  subroutine real_interface(this,x)
    import foo_parent
    class(foo_parent) :: this
    real :: x
  end subroutine
end interface

end module example_abstract

```

The implementation :

```plaintext
module example_module
use example_abstract
implicit none

type, extends(foo_parent) :: foo_child
  integer :: int_part = 0
  real :: real_part = 0.0
contains
  procedure :: add_integer => add_integer_child
  procedure :: add_real => add_real_child
  generic :: add => add_integer, add_real
end type foo_child

interface add
  module procedure add_integer_child, add_real_child
end interface add

contains

subroutine add_integer_child(this,x)
  class(foo_child) :: this
  integer :: x

  print *,this%int_part+x

end subroutine add_integer_child

subroutine add_real_child(this,x)
  class(foo_child) :: this
  real :: x

  print *,this%real_part+x

end subroutine add_real_child

end module example_module

```

The main program:

```plaintext
program example_program
use example_module
implicit none
type(foo_child) :: my_foo

call my_foo%add(1)
call my_foo%add(2.)

call add(my_foo,1)
call add(my_foo,2.)

end program example_program

```

The result should be

> $ ./a.out  
> 1  
> 2.000000  
> 1  
> 2.000000

But complier says :

> $ pgfortran --version
> 
> pgfortran 14.10-0 64-bit target on x86-64 Linux -tp sandybridge  
> The Portland Group - PGI Compilers and Tools  
> Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved.
> 
> $ pgfortran \*.F90  
> example\_abstract.F90:  
> example\_module.F90:  
> example\_program.F90:  
> PGF90-S-0155-Could not resolve generic procedure add (example\_program.F90: 9)  
> PGF90-S-0155-Could not resolve generic procedure add (example\_program.F90: 10)  
> 0 inform, 0 warnings, 2 severes, 0 fatal for example\_program

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [December 8, 2014, 5:00pm UTC](https://forums.developer.nvidia.com/t/could-not-resolve-generic-procedure/134331/2 "2014-12-08T17:00:07Z")

</div>

Thanks Pierre. I’ve recreated the issue here and sent it on to our engineers for further evaluation. The issue is being tracked as TPR#21154.

Best Regards,  
Mat

---

<div class="post-metadata">

**Author:** ![tull](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@tull](https://forums.developer.nvidia.com/u/tull)\
**Post date:** [February 13, 2015, 10:58pm UTC](https://forums.developer.nvidia.com/t/could-not-resolve-generic-procedure/134331/3 "2015-02-13T22:58:12Z")

</div>

TPR 21154 - UF: Syntax error “Could not resolve generic procedure” when using an interface in anabstract type

has been fixed in the current release.

thanks,  
dave
