| 1 |
module typebound_other |
| 2 |
use typebound_header, only: header => header_type |
| 3 |
|
| 4 |
implicit none |
| 5 |
|
| 6 |
type other_type |
| 7 |
type(header) :: var(2) |
| 8 |
contains |
| 9 |
procedure :: member => other_member |
| 10 |
end type other_type |
| 11 |
|
| 12 |
type outer_type |
| 13 |
type(other_type) :: other |
| 14 |
contains |
| 15 |
procedure :: nested_call |
| 16 |
end type outer_type |
| 17 |
|
| 18 |
contains |
| 19 |
|
| 20 |
module subroutine other_member(self, i, m) |
| 21 |
use typebound_header, only: member_routine => header_member_routine |
| 22 |
class(other_type) :: self |
| 23 |
integer, intent(in) :: i, m |
| 24 |
call member_routine(m) |
| 25 |
call self%var(i)%member_routine(m) |
| 26 |
end subroutine other_member |
| 27 |
|
| 28 |
subroutine nested_call(self, m) |
| 29 |
class(outer_type) :: self |
| 30 |
integer, intent(in) :: m |
| 31 |
call self%other%var(1)%member_routine(m) |
| 32 |
call self%other%var(2)%member_routine(m) |
| 33 |
end subroutine nested_call |
| 34 |
|
| 35 |
end module typebound_other |