Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26734 Discussions

Extends Abstract Parameterized Derived Type

Blane_J_
New Contributor I
79 Views

Hi, the following code snippet can be compiled but the compiler showed a warning messge that I didn't quite understand.

module test1
    implicit none
    
    private
    public :: tp1
    
    type, abstract :: tp1(length)
        private
        integer, len      :: length = 10
        character(length) :: s
    contains
        procedure(isub1), public, pass, deferred :: sub1
    end type tp1
    
    abstract interface
        subroutine isub1(this)
            import tp1
            class(tp1(*)), intent(in) :: this
        end subroutine isub1
    end interface
    
end module test1
    
module test2
    use test1, only: tp1
    implicit none
    
    private
    public :: tp2
    
    type, abstract, extends(tp1) :: tp2
    end type tp2
    
end module test2

warning #7925: An interface-block in a subprogram that contains an interface-body for a procedure defined by that subprogram is non-standard.   [TEST1^ISUB1]

If tp1 is not a parameterized type, the inheritance is just OK. So is there any restriction for extending an abstract parameterized derived type ?

0 Kudos
2 Replies
FortranFan
Honored Contributor II
79 Views

Looks like a false warning, suggest you submit this case to Intel support (OSC).

Blane_J_
New Contributor I
79 Views

Thanks FortranFan, I've reported it to the OSC.

Reply