Fortran · 585 bytes Raw Blame History
1 ! Generic interface visible through a renamed USE: `use m, only: a => add`
2 ! must let `a(1, 2)` resolve through the renamed handle. Audit-level:
3 ! catches the case where renamed USE associations weren't surfacing
4 ! NamedInterface symbols, leaving the call linker-unresolved.
5 ! CHECK: 3
6 module add_mod
7 implicit none
8 interface add
9 module procedure add_int
10 end interface
11 contains
12 integer function add_int(x, y)
13 integer, intent(in) :: x, y
14 add_int = x + y
15 end function
16 end module
17 program t
18 use add_mod, only: a => add
19 implicit none
20 print *, a(1, 2)
21 end program
22