• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1! RUN: %S/test_errors.sh %s %t %f18
2! Derived type parameters
3! C731 The same type-param-name shall not appear more than once in a given
4! derived-type-stmt.
5! C741 A type-param-name in a type-param-def-stmt in a derived-type-def shall
6! be one of the type-paramnames in the derived-type-stmt of that
7! derived-type-def.
8! C742 Each type-param-name in the derived-type-stmt in a derived-type-def
9! shall appear exactly once as a type-param-name in a type-param-def-stmt
10! in that derived-type-def.
11
12module m
13  !ERROR: Duplicate type parameter name: 'a'
14  type t1(a, b, a)
15    integer, kind :: a
16    integer(8), len :: b
17  end type
18  !ERROR: No definition found for type parameter 'b'
19  type t2(a, b, c)
20    integer, kind :: a
21    integer, len :: c
22  end type
23  !ERROR: No definition found for type parameter 'b'
24  type t3(a, b)
25    integer, kind :: a
26    integer :: b
27  end type
28  type t4(a)
29    integer, kind :: a
30    !ERROR: 'd' is not a type parameter of this derived type
31    integer(8), len :: d
32  end type
33  type t5(a, b)
34    integer, len :: a
35    integer, len :: b
36    !ERROR: Type parameter, component, or procedure binding 'a' already defined in this type
37    integer, len :: a
38  end type
39  !ERROR: No definition found for type parameter 'k'
40  !ERROR: No definition found for type parameter 'l'
41  type :: t6(k, l)
42    character(kind=k, len=l) :: d3
43  end type
44  type(t6(2, 10)) :: x3
45end module
46