Silverfrost Forums

Welcome to our forums

SEQUENCE attribute error message

27 Jul 2021 2:01 #28125

The following code consists of two modules and a program:

Module m1
   Type t
      Sequence
      Integer :: j
   End Type t
End Module m1

Module m2
Contains
 Function f(i, d)
   Use m1
   Integer :: f
   Integer, Intent(In) :: i
   Type(t), Intent(In), Optional :: d
   f = 0
   Return
 End Function f
End Module m2

Program p
   Use m2
   Print*, f(1)
End Program p

If the modules are stored in a different file from the program the following compilation error message is issued:

error 634 - Passing an argument of a derived type, such as Entity[0], requires the type have the SEQUENCE attribute

which seems spurious, in part because derived-type t is actually given the SEQUENCE attribute, but also because the program does not even call the function with a derived-type argument anyway.

The error message disappears if:

  1. the two modules are combined, while being kept in a separate file
  2. everything is kept in one file

I am running FTN95 version 8.70, but am pretty sure the same problem occurs in 8.80.

27 Jul 2021 5:45 #28128

Simon

Thank you for the bug report. The failure goes back to at least v4.90 and probably has been there since the outset.

You can probably use /ignore 634 as a temporary work-around.

27 Jul 2021 8:24 #28129

This has now been fixed for the next release of FTN95.

27 Jul 2021 1:55 #28130

Many thanks Paul. Using IGNORE 634 does avoid the problem for now.

Please login to reply.