Is it a bug that the following compiles? I have a base type which contains a procedure that takes a user defined function as input. User defined functions are defined in extended types. The following compiles successfully with ifort-13.1.3:
module m implicit none type, abstract :: base contains procedure :: use_f end type base type, extends(base) :: extended contains procedure :: f procedure :: test ! calls use_f which takes f as argument end type extended contains subroutine f(this) class(extended) :: this end subroutine f subroutine use_f(this, func) class(base) :: this interface subroutine func(this) import :: base class(base) :: this end subroutine func end interface end subroutine use_f subroutine test(this) class(extended) :: this call this%use_f(f) ! This is the important part! end subroutine test end module m end program
However, even though 'base' is compatible with 'extended', they are not the same type, which conflicts with 126.96.36.199 of F2008 if I read it correctly. So the compiler should at least give a warning with the -std08 flag.
(The issue first emerged here http://stackoverflow.com/questions/18683436/gfortran-fails-with-a-partic... .)