Skip to content

Commit 8e2dfc9

Browse files
committed
fix demo_copy_otehr
1 parent 7bebf15 commit 8e2dfc9

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

test/example/hashmaps/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ADD_DEMO(hashmaps_calls)
22
ADD_DEMO(hashmaps_copy_key)
3-
#ADD_DEMO(hashmaps_copy_other)
3+
ADD_DEMO(hashmaps_copy_other)
44
ADD_DEMO(hashmaps_entries)
55
ADD_DEMO(hashmaps_equal_keys)
66
ADD_DEMO(hashmaps_fnv_1a_hasher)
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
program demo_copy_other
22
use stdlib_hashmap_wrappers, only: &
3-
copy_other, get, other_type, set
3+
copy_other, other_type
44
use iso_fortran_env, only: int8
55
implicit none
66
type(other_type) :: other_in, other_out
77
integer(int8) :: i
8-
class(*), allocatable :: dummy
98
type dummy_type
109
integer(int8) :: value(15)
1110
end type
@@ -15,9 +14,9 @@ program demo_copy_other
1514
end do
1615
allocate (other_in%value, source=dummy_val)
1716
call copy_other(other_in, other_out)
18-
select type (other_out)
19-
typeis(dummy_type)
20-
print *, "other_in == other_out = ", &
21-
all(other_in%value == other_out%value)
17+
select type (out => other_out%value)
18+
type is (dummy_type)
19+
print *, "other_in == other_out = ", &
20+
all(dummy_val % value == out%value)
2221
end select
2322
end program demo_copy_other

0 commit comments

Comments
 (0)