3 ! Tests the fix for PR78108 in which an error was
4 ! triggered by the module procedures being added twice
5 ! to the operator interfaces.
7 ! Contributed by Damian Rouson <damian@sourceryinstitute.org>
15 generic :: operator(+) => add
17 generic :: operator(*) => mult
20 integer module function add(lhs,rhs)
22 class(foo), intent(in) :: lhs,rhs
24 integer module function mult(lhs,rhs)
26 class(foo), intent(in) :: lhs,rhs
30 submodule(foo_interface) foo_implementation
32 integer module function add(lhs,rhs)
34 class(foo), intent(in) :: lhs,rhs
35 add = lhs % x + rhs % x
37 integer module function mult(lhs,rhs)
39 class(foo), intent(in) :: lhs,rhs
40 mult = lhs % x * rhs % x
45 type(foo) :: a = foo (42)
46 type(foo) :: b = foo (99)
47 if (a + b .ne. 141) call abort
48 if (a * b .ne. 4158) call abort