xref: /llvm-project/flang/test/Semantics/resolve117.f90 (revision 2216c4c6a4e29a945af75f02b9a733ac5b016ed7)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2! Test name conflicts with type-bound generics
3module m
4  type base1(k)
5    integer, kind :: k = 4
6    real x
7   contains
8    procedure, nopass :: tbp => sub
9    generic :: gen => tbp
10  end type
11  type, extends(base1) :: ext1
12   contains
13    procedure, nopass :: sub
14    !ERROR: Type parameter, component, or procedure binding 'base1' already defined in this type
15    generic :: base1 => sub
16    !ERROR: Type bound generic procedure 'k' may not have the same name as a non-generic symbol inherited from an ancestor type
17    generic :: k => sub
18    !ERROR: Type bound generic procedure 'x' may not have the same name as a non-generic symbol inherited from an ancestor type
19    generic :: x => sub
20    !ERROR: Type bound generic procedure 'tbp' may not have the same name as a non-generic symbol inherited from an ancestor type
21    generic :: tbp => sub
22    generic :: gen => sub ! ok
23  end type
24 contains
25  subroutine sub
26  end
27end
28