Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Derived Type

Blane_J_
New Contributor I
2,228 Views

Hi to all. Is there any approach to define a derived type parameter whose components are decorated with PRIVATE attribute ? Like:

module test
    implicit none

    type :: my
        private
        integer :: a
    contains
        ...........some type-bound procedures.......
    end type my

    type(my), parameter :: const_my = my(a=100)      !!! This is wrong here !!!

end module test

If not, any suggestions that I could accomplish things like this, Thanks for reply.

0 Kudos
21 Replies
Blane_J_
New Contributor I
249 Views

jimdempseyatthecove wrote:

Presumably, the compiler could (would) catch the inout applied to a parameter(ized) type.

Jim Dempsey

Yes, Jim. The compiler gives the error:

error #6638: An actual argument is an expression or constant; this is not valid since the associated dummy argument has the explicit INTENT(OUT) or INTENT(INOUT) attribute.   [MAXVALUE]
error #6638: An actual argument is an expression or constant; this is not valid since the associated dummy argument has the explicit INTENT(OUT) or INTENT(INOUT) attribute.   [MAXVALUE]

 

0 Kudos
Reply