brintos

brintos / llvm-project-archived public Read only

0
0
Text · 912 B · 535576b Raw
32 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Check F'2023 C11673module m4  type :: base(kindparam, lenparam)5    integer, kind :: kindparam6    integer, len :: lenparam7  end type8  type, extends(base) :: ext19   contains10    procedure :: tbp11  end type12  type, extends(ext1) :: ext213  end type14 contains15  function tbp(x)16    class(ext1(123,*)), target :: x17    class(ext1(123,:)), pointer :: tbp18    tbp => x19  end20  subroutine test21    type(ext1(123,456)), target :: var22    select type (sel => var%tbp())23    type is (ext1(123,*)) ! ok24    type is (ext2(123,*)) ! ok25    !ERROR: Type specification 'ext1(kindparam=234_4,lenparam=*)' must be an extension of TYPE 'ext1(kindparam=123_4,lenparam=:)'26    type is (ext1(234,*))27    !ERROR: Type specification 'ext2(kindparam=234_4,lenparam=*)' must be an extension of TYPE 'ext1(kindparam=123_4,lenparam=:)'28    type is (ext2(234,*))29    end select30  end31end32