Using Intel XE 16 Update 3, the following code compiles without error. It looks as if the USE statement in the first procedure interface is visible to the second interface - I am not sure if this is as expected or if it is a bug.
MODULE M1 IMPLICIT NONE TYPE T INTEGER :: I END TYPE T END MODULE M1 MODULE M2 IMPLICIT NONE INTERFACE MODULE SUBROUTINE S1(V) USE M1 TYPE(T) :: V END SUBROUTINE S1 MODULE SUBROUTINE S2(W) TYPE(T) :: W END SUBROUTINE S2 END INTERFACE END MODULE M2
jmloriot, no - it won't be optional. But maybe you misunderstand the issue here. I think this problem is related to the use of submodules (that's what MODULE SUBROUTINE is doing here.) Can you provide an example of what you're doing now that you think will break?
It's even better to not use INTERFACE at all for Fortran code except when using submodules. But, yes, "interface to self" is not allowed by the standard and we properly diagnose it.