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

Missing interface check?

OP1
New Contributor II
244 Views

In the code below, I would have expected an error related to the type of F not being defined in the submodule function definition (starting at line 14), since I thought that only when MODULE PROCEDURE (instead of MODULE FUNCTION) was used the repetition of the procedure interface (found in the parent module) could be omitted.

This is with Intel Parallel Studio XE 17.

MODULE M
IMPLICIT NONE
INTERFACE
    MODULE FUNCTION F(I)
        IMPLICIT NONE
        INTEGER :: I,F
    END FUNCTION F
END INTERFACE
END MODULE M

SUBMODULE (M) S
IMPLICIT NONE
CONTAINS
    MODULE FUNCTION F(I)
        IMPLICIT NONE
        INTEGER :: I
        F = I
    END FUNCTION F
END SUBMODULE S

PROGRAM P
USE M
IMPLICIT NONE
WRITE(*,*) F(1)
END PROGRAM P

 

0 Kudos
1 Reply
Steven_L_Intel1
Employee
244 Views

Yes, we should report the missing declaration. It looks to me as if this will be fixed in 17.0 Update 1, based on my testing of internal builds.

0 Kudos
Reply