Name resolutions defers all resolution and checking of specific procedures
in non-type-bound generic interfaces to the end of the specification part.
This prevents expression analysis of references to generic functions in
specification expressions in interfaces from resolving.
Example (now a new test case in modfile07.f90):
module m12 interface generic module procedure specific end interface interface module subroutine s(a1,a2) character(*) a1 character(generic(a1)) a2 ! <-- end end interface contains pure integer function specific(x) character(*), intent(in) :: x specific = len(x) end end
The solution is to partially resolve specific procedures as they are
defined for each generic, when they can be resolved, with the final
pass at the end of the specification part to finish up any forward
references and emit the necessary error messages.
Making this fix caused some issues in module file output, which have
all been resolved by making this simplifying change: generics are
now all emitted to module file specification parts as their own
group of declarations at the end of the specification part,
followed only by namelists and COMMON blocks.