1 ! Copyright 2022-2024 Free Software Foundation, Inc.
3 ! This program is free software; you can redistribute it and/or modify
4 ! it under the terms of the GNU General Public License as published by
5 ! the Free Software Foundation; either version 3 of the License, or
6 ! (at your option) any later version.
8 ! This program is distributed in the hope that it will be useful,
9 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ! GNU General Public License for more details.
13 ! You should have received a copy of the GNU General Public License
14 ! along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ! Test fortran extends feature (also for chained extends).
23 type, extends(point) :: waypoint
27 type, extends(waypoint) :: fancywaypoint
38 type(fancywaypoint) :: fwp
39 type(waypoint), allocatable :: wp_vla(:)
42 allocate(wp_vla(3)) ! Before vla allocation
44 l = allocated(wp_vla) ! After vla allocation
55 wp_vla(1)%angle = 101.00
56 wp_vla(1)%coo(:) = 10.00
57 wp_vla(1)%coo(2) = 12.00
59 wp_vla(2)%angle = 102.00
60 wp_vla(2)%coo(:) = 20.00
61 wp_vla(2)%coo(2) = 22.00
63 wp_vla(3)%angle = 103.00
64 wp_vla(3)%coo(:) = 30.00
65 wp_vla(3)%coo(2) = 32.00
67 print *, wp, wp_vla, fwp ! After value assignment