- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following shows that 15.0 fails to diagnose a mismatch in the CLASS/TYPE characteristics of a dummy argument (which isn't the passed argument) for a procedure used to override a binding.
MODULE m
IMPLICIT NONE
TYPE, ABSTRACT :: Parent
CONTAINS
PROCEDURE(parent_Binding), DEFERRED :: Binding
END TYPE Parent
TYPE :: Thing
END TYPE Thing
ABSTRACT INTERFACE
SUBROUTINE parent_Binding(left, right)
IMPORT Parent
IMPORT Thing
IMPLICIT NONE
CLASS(Parent), INTENT(IN) :: left
CLASS(Thing), INTENT(IN) :: right ! <-- Polymorphic!
END SUBROUTINE parent_Binding
END INTERFACE
TYPE, EXTENDS(Parent) :: Extension
CONTAINS
PROCEDURE :: Binding => extension_Binding
END TYPE Extension
CONTAINS
SUBROUTINE extension_Binding(left, right)
CLASS(Extension), INTENT(IN) :: left
TYPE(Thing), INTENT(IN) :: right ! <-- Not polymorphic!
END SUBROUTINE extension_Binding
END MODULE m
>ifort /c /check:all /warn:all /standard-semantics /Od Poly-NotPoly-NotDiagnosed.f90 Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 20140726 Copyright (C) 1985-2014 Intel Corporation. All rights reserved. Poly-NotPoly-NotDiagnosed.f90(27): remark #7712: This variable has not been used. [LEFT] SUBROUTINE extension_Binding(left, right) -------------------------------^ Poly-NotPoly-NotDiagnosed.f90(27): remark #7712: This variable has not been used.SUBROUTINE extension_Binding(left, right) -------------------------------------^
Perhaps this isn't required for standard conformance, but it would sure be very nice to have, given similar capabilities of the compiler in this area, and how bewildering things get when you get this wrong!
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, we'll look into it
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