49 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! "Same type" checking for intrinsic assignment3module m14 type :: nonSeqType5 integer :: n16 end type7 type :: seqType8 sequence9 integer :: n210 end type11 type, bind(c) :: bindCType12 integer :: n313 end type14end module15 16program test17 use m1, modNonSeqType => nonSeqType, modSeqType => seqType, modBindCType => bindCType18 type :: nonSeqType19 integer :: n120 end type21 type :: seqType22 sequence23 integer :: n224 end type25 type, bind(c) :: bindCType26 integer :: n327 end type28 type(modNonSeqType) :: mns1, mns229 type(modSeqType) :: ms1, ms230 type(modBindCType) :: mb1, mb231 type(nonSeqType) :: ns1, ns232 type(seqType) :: s1, s233 type(bindCType) :: b1, b234 ! These are trivially ok35 mns1 = mns236 ms1 = ms237 mb1 = mb238 ns1 = ns239 s1 = s240 b1 = b241 ! These are ok per 7.5.2.442 ms1 = s143 mb1 = b144 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(modnonseqtype) and TYPE(nonseqtype)45 mns1 = ns146 !ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(nonseqtype) and TYPE(modnonseqtype)47 ns1 = mns148end49