xref: /llvm-project/flang/test/Semantics/resolve68.f90 (revision 2f999cce195946b66f968d50e38b06e6a1f60b8e)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Test resolution of type-bound generics.
3
4module m1
5  type :: t
6  contains
7    procedure, pass(x) :: add1 => add
8    procedure, nopass :: add2 => add
9    procedure :: add_real
10    generic :: g => add1, add2, add_real
11  end type
12contains
13  integer function add(x, y)
14    class(t), intent(in) :: x, y
15  end
16  integer function add_real(x, y)
17    class(t), intent(in) :: x
18    real, intent(in) :: y
19  end
20  subroutine test1(x, y, z)
21    type(t) :: x
22    integer :: y
23    integer :: z
24    !ERROR: No specific function of generic 'g' matches the actual arguments
25    z = x%g(y)
26  end
27  subroutine test2(x, y, z)
28    type(t) :: x
29    real :: y
30    integer :: z
31    !ERROR: No specific function of generic 'g' matches the actual arguments
32    z = x%g(x, y)
33  end
34end
35