Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29229 Discussions

Potential bug when calling nested parameterized derived types

WileyOne
Novice
1,921 Views

Compiler: ifx (IFX) 2025.2.1

OS: Rocky Linux 8.9 (Green Obsidian)

I've found a potential bug at the intersection of parameterized derived types, nesting, and the generic overload. The compiler won't build the code and says, "there is no matching specific function for this type bound generic function reference", but it looks good to me.

If I remove the type parameter, the code compiles. Furthermore, if "generic" is switched to "procedure", it compiles fine.

Am I missing something, or is this a bug?

module Base_Header

    implicit none

    type, abstract :: base(param1)
        integer, len :: &
            param1

        contains
        generic,   public  :: method => method_ ! switch "generic" to "procedure" and this compiles
        procedure, private :: method_
    end type

    type, extends(base) :: extension
        class(base(:)), allocatable :: something
        contains
        procedure, public :: doSomething
    end type

    contains

    function method_(this,x) result(y)
        class(base(*)), intent(in) :: this
        real(8),          intent(in) :: x
        real(8)                      :: y

        y = 2*x
    end function

    function doSomething(this,x) result(y)
        class(extension(*)), intent(in) :: this
        real(8),               intent(in) :: x
        real(8)                           :: y

        y = this%something%method(x)
    end function

end module

 

0 Kudos
3 Replies
WileyOne
Novice
695 Views

I'm following up on this issue. Is someone from Intel able to confirm whether or not this is a bug?

0 Kudos
Ron_Green
Moderator
448 Views

apologies for the delay - layoffs and summer vacation to blame.

NAG accepts this code.  Gfortran 14.2 gets an ICE. 

 

This looks like an ifx bug but I will confirm with our Standards reps. 

 

Thank you for the ping,.  I will follow up on this report shortly.

0 Kudos
Ron_Green
Moderator
396 Views

we all agree that this is valid code. The ifx error message is incorrect. Bug ID is CMPLRLLVM-70117


0 Kudos
Reply