| 1 |
! { dg-do compile } |
| 2 |
! |
| 3 |
! PR 55199: [OOP] Equivalenced variable has wrong type when used with generic member function |
| 4 |
! |
| 5 |
! Contributed by Rich Townsend <[email protected]> |
| 6 |
|
| 7 |
module assoc_err_m |
| 8 |
implicit none |
| 9 |
type :: foo_t |
| 10 |
contains |
| 11 |
procedure :: func_1 |
| 12 |
generic :: func => func_1 |
| 13 |
end type |
| 14 |
contains |
| 15 |
real function func_1 (this) |
| 16 |
class(foo_t), intent(in) :: this |
| 17 |
end function |
| 18 |
end module |
| 19 |
|
| 20 |
program assoc_err |
| 21 |
use assoc_err_m |
| 22 |
implicit none |
| 23 |
type(foo_t) :: f |
| 24 |
associate(b => f%func()) |
| 25 |
print *, 1. + b |
| 26 |
end associate |
| 27 |
end program |