- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
compiling the attached code, ifort complains that
ifort -c test-add.f90 test-add.f90(36): error #8314: If the rightmost part-name is of abstract type, data-ref shall be polymorphic [ADD]
call a%assign( a%add(b) )
--------------------^
compilation aborted for test-add.f90 (code 1)
My question is whether this error is correct; in particular, all my
variables are of abstract type c_ode, so I don't see the problem. As a
note, the code compiles with gfortran.
Thank you,
Marco
compiling the attached code, ifort complains that
ifort -c test-add.f90 test-add.f90(36): error #8314: If the rightmost part-name is of abstract type, data-ref shall be polymorphic [ADD]
call a%assign( a%add(b) )
--------------------^
compilation aborted for test-add.f90 (code 1)
My question is whether this error is correct; in particular, all my
variables are of abstract type c_ode, so I don't see the problem. As a
note, the code compiles with gfortran.
Thank you,
Marco
[bash]module mod_m implicit none type, abstract :: c_ode contains procedure(i_add), deferred, pass(x) :: add procedure(i_assign), deferred, pass(y) :: assign end type c_ode abstract interface pure function i_add(x,y) result(z) import :: c_ode implicit none class(c_ode), intent(in) :: x, y class(c_ode), allocatable :: z end function i_add end interface abstract interface pure subroutine i_assign(y,x) import :: c_ode implicit none class(c_ode), intent(in) :: x class(c_ode), intent(out) :: y end subroutine i_assign end interface contains pure subroutine sub(a,b) class(c_ode), intent(in) :: b class(c_ode), intent(out) :: a ! a = a+b call a%assign( a%add(b) ) end subroutine sub end module mod_m [/bash]
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, this is our bug. It's an issue we've been wrestling with for a while now as the wording in the standard seemed ambiguous. However, we've resolved that and fixed the bug - the fix should appear in an update later this year. The issue ID is DPD200170220.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, thank you, then I'm looking forward to seing the new version.
Marco
Marco
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