| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! Test the fix for the regression caused by r16-669-gd31ab498b12ebb - See line 59. |
| 4 |
! |
| 5 |
! Contributed by Zaak Beekman <[email protected]> |
| 6 |
! |
| 7 |
module inner_m |
| 8 |
implicit none |
| 9 |
type :: dt_t |
| 10 |
integer, allocatable :: val |
| 11 |
end type |
| 12 |
type, abstract :: inner_t |
| 13 |
contains |
| 14 |
procedure(summary_i), deferred :: summary |
| 15 |
end type |
| 16 |
abstract interface |
| 17 |
function summary_i(self) |
| 18 |
import :: inner_t, dt_t |
| 19 |
class(inner_t), intent(in) :: self |
| 20 |
type(dt_t) :: summary_i |
| 21 |
end function |
| 22 |
end interface |
| 23 |
end module inner_m |
| 24 |
|
| 25 |
module concrete_m |
| 26 |
use inner_m, only: inner_t, dt_t |
| 27 |
implicit none |
| 28 |
type, extends(inner_t) :: concrete_t |
| 29 |
contains |
| 30 |
procedure :: summary |
| 31 |
end type |
| 32 |
contains |
| 33 |
function summary(self) |
| 34 |
class(concrete_t), intent(in) :: self |
| 35 |
type(dt_t) :: summary |
| 36 |
end function |
| 37 |
end module concrete_m |
| 38 |
|
| 39 |
module outer_m |
| 40 |
use inner_m, only: inner_t, dt_t |
| 41 |
use concrete_m, only: concrete_t |
| 42 |
implicit none |
| 43 |
type :: outer_t |
| 44 |
class(inner_t), allocatable :: component |
| 45 |
contains |
| 46 |
procedure :: summary |
| 47 |
end type |
| 48 |
interface |
| 49 |
module function summary(self) result(res) |
| 50 |
class(outer_t), intent(in) :: self |
| 51 |
type(dt_t) :: res |
| 52 |
end function |
| 53 |
end interface |
| 54 |
end module outer_m |
| 55 |
|
| 56 |
submodule(outer_m) outer_impl |
| 57 |
contains |
| 58 |
module procedure summary |
| 59 |
res = self%component%summary() ! ICE in trans_scalar_assign here |
| 60 |
end procedure |
| 61 |
end submodule outer_impl |