mirror of
https://github.com/autc04/Retro68.git
synced 2024-09-28 18:56:06 +00:00
36 lines
765 B
Fortran
36 lines
765 B
Fortran
! { dg-do compile }
|
|
!
|
|
! PR 48095: [OOP] Invalid assignment to procedure pointer component not rejected
|
|
!
|
|
! Contributed by Arjen Markus <arjen.markus895@gmail.com>
|
|
|
|
module m
|
|
|
|
implicit none
|
|
|
|
type :: rectangle
|
|
procedure(get_area), pointer :: get_special_area
|
|
end type rectangle
|
|
|
|
abstract interface
|
|
real function get_area( this )
|
|
import :: rectangle
|
|
class(rectangle), intent(in) :: this
|
|
end function get_area
|
|
end interface
|
|
|
|
contains
|
|
|
|
real function get_my_area( this )
|
|
type(rectangle), intent(in) :: this
|
|
get_my_area = 3.0
|
|
end function get_my_area
|
|
|
|
end module
|
|
|
|
|
|
use m
|
|
type(rectangle) :: rect
|
|
rect%get_special_area => get_my_area ! { dg-error "Interface mismatch in procedure pointer assignment" }
|
|
end
|