- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't think that this is right! It's not polymorphic ....
MODULE Assign
IMPLICIT NONE
INTEGER :: factor
TYPE, PUBLIC :: Mytype
INTEGER :: comp = 123
CONTAINS
PROCEDURE, PRIVATE :: Copy
GENERIC :: ASSIGNMENT (=) => Copy
END TYPE Mytype
CONTAINS
PURE SUBROUTINE Copy (a, b)
CLASS(Mytype), INTENT(OUT) :: a
CLASS(Mytype), INTENT(IN) :: b
a%comp = b%comp*factor
END SUBROUTINE Copy
END MODULE Assign
PROGRAM Main
USE Assign
IMPLICIT NONE
TYPE(Mytype) :: coarray
factor = THIS_IMAGE()
SYNC ALL
IF (THIS_IMAGE() == 1) THEN
coarray = coarray[2] ! (a)
coarray[3] = coarray ! (b)
coarray[4] = coarray[5] ! (c)
END IF
END PROGRAM Main
ifort version 14.0.2
gerbil.f90(25): error #8392: If the actual argument is a polymorphic coindexed object, the dummy argument must not be polymorphic. [COARRAY]
coarray = coarray[2] ! (a)
------------------^
gerbil.f90(26): error #8392: If the actual argument is a polymorphic coindexed object, the dummy argument must not be polymorphic. [COARRAY]
coarray[3] = coarray ! (b)
--------^
gerbil.f90(27): error #8392: If the actual argument is a polymorphic coindexed object, the dummy argument must not be polymorphic. [COARRAY]
coarray[4] = coarray[5] ! (c)
--------^
gerbil.f90(27): error #8392: If the actual argument is a polymorphic coindexed object, the dummy argument must not be polymorphic. [COARRAY]
coarray[4] = coarray[5] ! (c)
---------------------^
compilation aborted for gerbil.f90 (code 1)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Nick.
I agree with you that this error message is unwarranted. I'll note that defined assignment, per se, isn't relevant as you can see the same issue if you call Copy directly. I have escalated this as issue DPD200359259 and will let you know of any progress.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We fixed the error message, but then found that the call doesn't work correctly. Working on that one....

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