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

SubModule with Type-Bound Procedures

gao_l_
Beginner
1,289 Views
Hello Someone,
I wrote a module and its submodule, and defined a type with Bundling procedure in it, but I'll find a link error.
If I use the comment statements, I can run normally. Why is that?
 
The compiler is Intel(R) Visual Fortran Compiler 18.0.1.156[IA-32]
 
Module MyMod
  Implicit None
  Type , public :: T_My
  contains
    Procedure , nopass :: pubName => prvName
    !Procedure , nopass ::  prvName
    !Generic :: pubName => prvName
  End Type T_My
 
  interface
    Module Subroutine prvName()
    End Subroutine prvName
  end interface
End Module MyMod
 
SubModule(MyMod) MyModS
contains
  Module Procedure prvName
    write(*,*) "Hello"
  End Procedure prvName
End SubModule MyModS
 
Program Main
  use MyMod
  Implicit None
  type(T_My) :: my
  call my%pubName()
End Program Main
0 Kudos
2 Replies
FortranFan
Honored Contributor III
1,289 Views

@gao l.,

It's a bug in the compiler which, to my understanding, got fixed in Intel Fortran 18.0 Update 2.  Your code links and works as expected using  Intel Fortran 18.0 Update 2, also Update 3, as well as 19.0 Beta Update 1. 

0 Kudos
gao_l_
Beginner
1,289 Views

Thanks,The world looks much more reasonable.

0 Kudos
Reply