1! { dg-do compile } 2! Test the final fix for PR42353, in which a compilation error was 3! occurring because the derived type of the initializer of the vtab 4! component '$extends' was not the same as that of the component. 5! 6! Contributed by Harald Anlauf <anlauf@gmx.de> 7! 8module abstract_vector 9 implicit none 10 11 type, abstract :: vector_class 12 end type vector_class 13end module abstract_vector 14!------------------------- 15module concrete_vector 16 use abstract_vector 17 implicit none 18 19 type, extends(vector_class) :: trivial_vector_type 20 end type trivial_vector_type 21 22 private :: my_assign 23contains 24 subroutine my_assign (this,v) 25 class(trivial_vector_type), intent(inout) :: this 26 class(vector_class), intent(in) :: v 27 end subroutine my_assign 28end module concrete_vector 29!--------------------------- 30module concrete_gradient 31 use abstract_vector 32 implicit none 33 34 type, abstract, extends(vector_class) :: gradient_class 35 end type gradient_class 36 37 type, extends(gradient_class) :: trivial_gradient_type 38 end type trivial_gradient_type 39 40 private :: my_assign 41contains 42 subroutine my_assign (this,v) 43 class(trivial_gradient_type), intent(inout) :: this 44 class(vector_class), intent(in) :: v 45 end subroutine my_assign 46end module concrete_gradient 47!---------------------------- 48module concrete_inner_product 49 use concrete_vector 50 use concrete_gradient 51 implicit none 52end module concrete_inner_product 53