- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I get this error when compiling the following code with ifort 11.1.072 (20100414). Error msg:
[plain]test.F90(5): error #8313: A deferred binding is inherited by non-abstract type; It must be overridden [INDEX]
PROCEDURE(ReturnInt_Grandparent), DEFERRED :: Index
----------------------------------------------------^[/plain] Code:
[fortran]MODULE testmod
IMPLICIT NONE
TYPE, ABSTRACT :: Grandparent
CONTAINS
PROCEDURE(ReturnInt_Grandparent), DEFERRED :: Index
END TYPE Grandparent
TYPE, ABSTRACT, EXTENDS(Grandparent) :: Parent
END TYPE Parent
ABSTRACT INTERFACE
PURE FUNCTION ReturnInt_Grandparent(obj)
IMPORT :: Grandparent
CLASS(Grandparent), INTENT(IN) :: obj
INTEGER :: ReturnInt_Grandparent
END FUNCTION ReturnInt_Grandparent
END INTERFACE
TYPE, EXTENDS(Parent) :: Child ! works with EXTENDS(Grandparent)
INTEGER :: items(10)
CONTAINS
PROCEDURE, NON_OVERRIDABLE :: Index => Index_Child
END TYPE Child
CONTAINS
PURE FUNCTION Index_Child(obj)
IMPLICIT NONE
CLASS(Child), INTENT(IN) :: obj
INTEGER :: Index_Child
Index_Child = SIZE(obj%items,1)
END FUNCTION Index_Child
END MODULE testmod
PROGRAM test
USE testmod
IMPLICIT NONE
TYPE(Child) :: a
WRITE(*,*) a%Index()
END PROGRAM test[/fortran] As noted, if I switch EXTENDS(Parent) to EXTENDS(Grandparent), this code compiles. I believe that this is an ifort error - in this case the "Parent" type is still abstract and should not need to override "Index", and the first non-abstract type ("Child") does do so.Of course, it's possible that I'm in error! Let me know. FYI, I may have submitted a similar error report in the past, I should check...
Thanks!
Jared
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You did report a similar error in comp.lang.fortran and that one is fixed, but this variant is still broken. Thanks, I'll send this to the developers. I think your code is correct. Issue ID is DPD200154706.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. Sorry to be a pest on this one! :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are absolutely NOT a "pest"! We appreciate the reports, though of course wish we didn't have the bugs in the first place!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I expect this issue to be resolved in Update 7, currently scheduled for August.
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