Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
30 Views

SubModule with Type-Bound Procedures

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
Highlighted
Valued Contributor III
30 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
Highlighted
Beginner
30 Views

Thanks,The world looks much more reasonable.

0 Kudos