- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
When I compile the attached code with ifort12.1.0, I get the error:
test.f90(32): error #8382: The dummy arguments of an overriding and overridden binding that correspond by position must have the same names. [TESTMOD0^EXT]
procedure :: init => t1init
^
compilation aborted for test.f90 (code 1)
I normally use gfortran4.6.2 and it's never complained about this sort of thing, so I've assumed it's legal. Seems like ifort names the external subroutine with the name of the module so it appears different in the two modules.
Any help would be appreciated. Thanks
------------------------------------------------
subroutine ext ( i )
integer, intent(out) :: i
i = 0
end subroutine ext
module testMod0
type :: t0
integer :: i0
contains
procedure :: init
end type t0
contains
subroutine init ( myT, ext )
class(t0) :: myT
procedure() :: ext
write(6,*) ' 10 '
end subroutine init
end module testMod0
module testMod1
use testMod0, only : t0
type, extends(t0) :: t1
integer :: i1
contains
procedure :: init => t1init
end type t1
contains
subroutine t1init ( myT, ext )
class(t1 ) :: myT
procedure() :: ext
write(6,*) ' 20 '
end subroutine t1init
end module testMod1
When I compile the attached code with ifort12.1.0, I get the error:
test.f90(32): error #8382: The dummy arguments of an overriding and overridden binding that correspond by position must have the same names. [TESTMOD0^EXT]
procedure :: init => t1init
^
compilation aborted for test.f90 (code 1)
I normally use gfortran4.6.2 and it's never complained about this sort of thing, so I've assumed it's legal. Seems like ifort names the external subroutine with the name of the module so it appears different in the two modules.
Any help would be appreciated. Thanks
------------------------------------------------
subroutine ext ( i )
integer, intent(out) :: i
i = 0
end subroutine ext
module testMod0
type :: t0
integer :: i0
contains
procedure :: init
end type t0
contains
subroutine init ( myT, ext )
class(t0) :: myT
procedure() :: ext
write(6,*) ' 10 '
end subroutine init
end module testMod0
module testMod1
use testMod0, only : t0
type, extends(t0) :: t1
integer :: i1
contains
procedure :: init => t1init
end type t1
contains
subroutine t1init ( myT, ext )
class(t1 ) :: myT
procedure() :: ext
write(6,*) ' 20 '
end subroutine t1init
end module testMod1
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the nice test case. I can reproduce the problem and it is indeed a bug in ifort. I have escalated this as issue DPD200176430. It appears to be triggered by having a procedure (or external) as an argument to the type-bound procedure, and having the ONLY clause. If you remove the ONLY on the use of testMod0, it compiles ok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply. It's good to know that removing the only will make it compile. I was worried I'd have to make some major change to my code to get it to work with ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect this problem to be fixed in Update 9.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page