- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all!
implicit none
private public :: & opr_t, & operator(*)
type :: opr_t private real :: factor end type opr_t
interface operator (*) module procedure mlt end interface
contains
elemental function mlt(aa, bb) result(cc) type(opr_t), intent(in) :: aa type(opr_t), intent(in) :: bb type(opr_t) :: cc cc%factor=aa%factor*bb%factor return end function mlt
end module opr_m
program opr use opr_m implicit none call dummy() stopend program opr
Compiling:
ifort -warn interfaces osc.f90
I get:
osc.f90: error #7977: The type of the function reference does not match the type of the function definition. [OPR_M^MLT]
If the "call dummy()" line is commented the error goes away.
Seems like a bug.
Best regards,
Jos Rui
!-- Code ---------------
module opr_m
implicit none
private
public :: &
opr_t, &
operator(*)
type :: opr_t
private
real :: factor
end type opr_t
interface operator (*)
module procedure mlt
end interface
contains
elemental function mlt(aa, bb) result(cc)
type(opr_t), intent(in) :: aa
type(opr_t), intent(in) :: bb
type(opr_t) :: cc
cc%factor=aa%factor*bb%factor
return
end function mlt
end module opr_m
program opr
use opr_m
implicit none
call dummy()
stop
end program opr
module opr_mimplicit none
private public :: & opr_t, & operator(*)
type :: opr_t private real :: factor end type opr_t
interface operator (*) module procedure mlt end interface
contains
elemental function mlt(aa, bb) result(cc) type(opr_t), intent(in) :: aa type(opr_t), intent(in) :: bb type(opr_t) :: cc cc%factor=aa%factor*bb%factor return end function mlt
end module opr_m
program opr use opr_m implicit none call dummy() stopend program opr
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ups... I pasted the code twice...
It ends at "end program opr"
Sorry... :-(
Best regards,
Jos Rui
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which compiler version are you using? I can't reproduce this in reasonably current versions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Steve!
$ ifort -V
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.3.174 Build 20110309
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
$ ifort -warn interfaces osc.f90
osc.f90: error #7977: The type of the function reference does not match the type of the function definition. [OPR_M^MLT]
compilation aborted for osc.f90 (code 1)
Best regards,
Jos Rui
[fortran]module opr_m implicit none private public :: & opr_t, & operator(*) type :: opr_t private real :: factor end type opr_t interface operator (*) module procedure mlt end interface contains elemental function mlt(aa, bb) result(cc) type(opr_t), intent(in) :: aa type(opr_t), intent(in) :: bb type(opr_t) :: cc cc%factor=aa%factor*bb%factor return end function mlt end module opr_m program opr use opr_m implicit none call dummy() stop end program opr [/fortran]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, I didn't go back that far. Please try again with a current version, such as 12.1.7. (Composer XE 2011 Update 7)
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