This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/70562] New: User defined assignment does not distinguish between ranks
- From: "baradi09 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 06 Apr 2016 13:03:41 +0000
- Subject: [Bug fortran/70562] New: User defined assignment does not distinguish between ranks
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70562
Bug ID: 70562
Summary: User defined assignment does not distinguish between
ranks
Product: gcc
Version: 5.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: baradi09 at gmail dot com
Target Milestone: ---
User defined assignment for derived types fails to compile, if the signature of
the various assignments only differ in their rank. The snippet further below
fails to compile with the error message
generic :: assignment(=) => assignScalar, assignArray
1
Error: âassignscalarâ and âassignarrayâ for GENERIC â=â at (1) are ambiguous
although the two interfaces are not ambiguous, as their differ in ther ranks.
Best regards, BÃlint
module typedefs
implicit none
type :: tt
integer :: data(2)
contains
procedure :: assignScalar
procedure :: assignArray
generic :: assignment(=) => assignScalar, assignArray
end type tt
contains
subroutine assignScalar(this, other)
class(tt), intent(inout) :: this
class(*), intent(in) :: other
print *, "assignScalar"
end subroutine assignScalar
subroutine assignArray(this, other)
class(tt), intent(inout) :: this
class(*), intent(in) :: other(:)
print *, "assignScalar"
end subroutine assignArray
end module typedefs