Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

generic type bound proc with bibding in a base class

$
0
0

Hi,

   ifort does not compile the following code because:

ifort -c m.f90

m.f90(15): error #8423: In GENERIC type bound procedure definition each binding name must be the name of a specific binding of the type.   [FF]

  generic :: gen_f => ff

----------------------^

compilation aborted for m.f90 (code 1)

I wander whether this error is correct, since I would expect the

procedure ff to be equally available in t1 and t2 - but I must say

that I don't know what the standard says about this.



ifort -V

Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0 Build 20140120

 

module m

 implicit none

 private

 type, abstract :: t1

 contains

  !generic :: gen_f => ff ! works

  procedure, pass(this) :: ff

 end type t1

 type, abstract, extends(t1) :: t2

 contains

  generic :: gen_f => ff ! does not work

 end type t2

contains

 subroutine ff(this)

  class(t1) :: this

   ! do nothing

 end subroutine ff

end module m

 


Viewing all articles
Browse latest Browse all 2583

Trending Articles



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