Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28597 Discussions

Parameterized derived types: compiler fails to recognize PRIVATE attribute of type components

FortranFan
Honored Contributor III
249 Views

The compiler, including the current latest version (16, update 1), doesn't raise an error with the following code:

module m

   implicit none

   private

   type, public :: t(K)
      integer, kind :: K
      private
      integer(kind=K) :: I
   end type t

end module m
program p

   use m, only : t

   implicit none

   type(t(K=4)) :: foo

   foo%I = 42  !.. I is a private component of t

   stop

end program p
1>Compiling with Intel(R) Visual Fortran Compiler 16.0.1.146 [Intel(R) 64]...
1>m.f90
1>p.f90
1>p - 0 error(s), 0 warning(s)

 

0 Kudos
2 Replies
Steven_L_Intel1
Employee
249 Views

How interesting.  Escalated as issue DPD200379545.  Thanks.

0 Kudos
Steven_L_Intel1
Employee
249 Views

Fixed for a major release later this year.

0 Kudos
Reply