| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR fortran/42769 |
| 4 |
! This test used to be rejected because the typebound call A%GET was |
| 5 |
! simplified to MY_GET which is an ambiguous name in the main program |
| 6 |
! namespace. |
| 7 |
! |
| 8 |
! Original testcase by Salvator Filippone <[email protected]> |
| 9 |
! Reduced by Janus Weil <[email protected]> |
| 10 |
|
| 11 |
module mod1 |
| 12 |
type :: t1 |
| 13 |
contains |
| 14 |
procedure, nopass :: get => my_get |
| 15 |
end type |
| 16 |
contains |
| 17 |
subroutine my_get() |
| 18 |
print *,"my_get (mod1)" |
| 19 |
end subroutine |
| 20 |
end module |
| 21 |
|
| 22 |
module mod2 |
| 23 |
contains |
| 24 |
subroutine my_get() ! must have the same name as the function in mod1 |
| 25 |
print *,"my_get (mod2)" |
| 26 |
end subroutine |
| 27 |
end module |
| 28 |
|
| 29 |
use mod2 |
| 30 |
use mod1 |
| 31 |
type(t1) :: a |
| 32 |
call call_get |
| 33 |
contains |
| 34 |
subroutine call_get |
| 35 |
call a%get() |
| 36 |
end subroutine call_get |
| 37 |
end |
| 38 |
|
| 39 |
|