xref: /llvm-project/flang/test/Semantics/resolve22.f90 (revision 0c190575ebfc81e117d95e2eca25789610192125)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2subroutine s1
3  !OK: interface followed by type with same name
4  interface t
5  end interface
6  type t
7  end type
8  type(t) :: x
9  x = t()
10end subroutine
11
12subroutine s2
13  !OK: type followed by interface with same name
14  type t
15  end type
16  interface t
17  end interface
18  type(t) :: x
19  x = t()
20end subroutine
21
22subroutine s3
23  type t
24  end type
25  interface t
26  end interface
27  !ERROR: 't' is already declared in this scoping unit
28  type t
29  end type
30  type(t) :: x
31  x = t()
32end subroutine
33
34module m4
35  type t1
36    class(t2), pointer :: p => null()
37  end type
38  type t2
39  end type
40  interface t2
41    procedure ctor
42  end interface
43 contains
44  function ctor()
45    type(t2) ctor
46  end function
47end module
48