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.
29280 Discussions

Parameterized type - Dummy argument differs from actual argument

Wolf_W_
New Contributor I
620 Views

Hi, i ran into a problem with parameterized derived types. If i try to compile the following code with the 15.0.4 Compiler on Windows i get error 6633
"The type of the actual argument differs from the type of the dummy argument.   ". (in Line 37)

module M_MATRIX
  use, intrinsic :: iso_fortran_env, only: real64
  type, public :: DT_MATRIX(knd, k, n)
    integer, kind :: knd
    integer, len  :: k
    integer, len  :: n
    real(kind = knd), dimension(k,n) :: m
  end type
end module M_MATRIX

!-------------------------------------------------------

module M_EXAMPLE
  use M_MATRIX
!  public           ! <- compiles

  private            !
  public :: foo      ! <- does not compile

  contains
  subroutine foo(matrix)
    type(DT_MATRIX(real64,2,2)) :: matrix
    matrix%m = 0.0d0
  end subroutine

end module M_EXAMPLE

!-------------------------------------------------------

program test
  use M_EXAMPLE !, only: foo ! <- "only" disables the public-workaround
  use M_MATRIX
  Implicit none

  type(DT_MATRIX(real64,2,2)) :: A

  call foo(A)

end

There seems to be no change in behavior, whether there are kind- or len-parameters in the type definition of DT_MATRIX.

As i searched the forum, i read about some bug-fixes to PTDs in the 16.0 release, so this might be unimportant.

Wolf

0 Kudos
2 Replies
Steven_L_Intel1
Employee
620 Views

This still fails in 16.0. I don't think the error is justified and will send this on to the developers. Clearly it has something to do with accessibility of names from M_EXAMPLE but I don't see why. Issue ID is DPD200374900.

0 Kudos
Steven_L_Intel1
Employee
620 Views

This has been fixed - I suspect that the fix missed the cutoff for Update 1 but, if so, it will be in Update 2 (February).

0 Kudos
Reply