- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, the example below produces two warnings #8450:
"The type/rank signature for this specific function and its arguments matches another specific function that shares the same OPERATOR generic binding. [BINARY_OP_B]"
"The type/rank signature for this specific function and its arguments matches another specific function that shares the same OPERATOR generic binding. [BINARY_OP_C]"
The warnings disappear, when the unitary operator binding (line 24) is commented out.
Is this a bug? Or am i doing something wrong?
Greetings
Wolf
Compiler: 15.5 and 16.1
module FOO
implicit none
!=================================================================
type, abstract :: ABSTRACT_TYPE
contains
procedure :: binary_op_A
generic :: operator(.A.) => binary_op_A
procedure :: binary_op_B
generic :: operator(.B.) => binary_op_B
procedure :: binary_op_C
generic :: operator(.C.) => binary_op_C
end type ABSTRACT_TYPE
!=================================================================
type, extends (ABSTRACT_TYPE) :: EXTENDED_TYPE
contains
procedure :: unitary_op
generic :: operator(.U.) => unitary_op !no warning without this line
generic :: normiere => unitary_op
end type EXTENDED_TYPE
!=================================================================
contains
!=================================================================
elemental function unitary_op(rhs) result(res)
class(EXTENDED_TYPE), intent(in ) :: rhs
type(EXTENDED_TYPE) :: res
end function unitary_op
elemental function binary_op_A(lhs, rhs) result(res)
class(ABSTRACT_TYPE), intent(in ) :: lhs, rhs
real :: res
end function binary_op_A
elemental function binary_op_B(lhs, rhs) result(res)
class(ABSTRACT_TYPE), intent(in ) :: lhs, rhs
type(EXTENDED_TYPE) :: res
end function binary_op_B
elemental function binary_op_C(lhs, rhs) result(res)
class(ABSTRACT_TYPE), intent(in ) :: lhs, rhs
real :: res
end function binary_op_C
!=================================================================
end module FOO
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To me, the compiler warnings of 8450 seem spurious for the code shown in the original post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is weird... Escalated as issue DPD200380766.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fixed for a release later this year.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page