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

SubModule with Type-Bound Procedures

gao_l_
Beginner
587 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 II
587 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
587 Views

Thanks,The world looks much more reasonable.

0 Kudos
Reply