[flang-commits] [flang] [flang][semantics] make sure dynamic type inquiry functions take extensible or unlimited polymorphic types (PR #162931)

Andre Kuhlenschmidt via flang-commits flang-commits at lists.llvm.org
Tue Oct 14 13:32:17 PDT 2025


================
@@ -0,0 +1,68 @@
+! RUN: %python %S/test_errors.py %s %flang_fc1
+
+module m
+    type :: t1
+      real :: x
+    end type
+    type :: t2(k)
+      integer, kind :: k
+      real(kind=k) :: x
+    end type
+    type :: t3
+      real :: x
+    end type
+    type, extends(t1) :: t4
+      integer :: y
+    end type
+    type :: t5
+      sequence
+      integer :: x
+      integer :: y
+    end type
+
+    integer :: i
+    real :: r
+    type(t1) :: x1, y1
+    type(t2(4)) :: x24, y24
+    type(t2(8)) :: x28
+    type(t3) :: x3
+    type(t4) :: x4
+    type(t5) :: x5
+    class(t1), allocatable :: a1
+    class(t3), allocatable :: a3
+
+    logical :: t1_1 = same_type_as(x1, x1)
----------------
akuhlens wrote:

What are you expecting here? Are you thinking that I make these parameters and then assert or print there answers? 

https://github.com/llvm/llvm-project/pull/162931


More information about the flang-commits mailing list