Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29430 Discussions

Identifying location in source with error 8322 (missing deferred binding)

IanH
Honored Contributor III
925 Views

If a non-abstract extension of a abstract derived type fails to implement a deferred binding of the parent type, then ifort 16.0 (and earlier) issue a diagnostic without particularly useful source location information.  If the parent type is in the same program unit as the extension with the missing binding, then the compiler will identify the binding in the parent, while if the parent type is in a different program unit, then no line location information is provided at all. 

Could this be please changed so that the faulty non-abstract extension type is nominated by the error location.

For example:

MODULE p
  IMPLICIT NONE
  TYPE, ABSTRACT :: Parent
  CONTAINS
    PROCEDURE(intf), DEFERRED, NOPASS :: OOPSIMadeAMistake
  END TYPE Parent
  ABSTRACT INTERFACE
    SUBROUTINE intf
    END SUBROUTINE intf
  END INTERFACE
END MODULE p
MODULE m
  USE p
  IMPLICIT NONE
  TYPE, EXTENDS(Parent) :: A
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE A
  TYPE, EXTENDS(Parent) :: B
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE B
  TYPE, EXTENDS(Parent) :: C
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE C
  TYPE, EXTENDS(Parent) :: D
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE D
  TYPE, EXTENDS(Parent) :: E
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE E
  TYPE, EXTENDS(Parent) :: F
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE F
  TYPE, EXTENDS(Parent) :: G
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE G
  TYPE, EXTENDS(Parent) :: H
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE H
  TYPE, EXTENDS(Parent) :: I
  CONTAINS
    PROCEDURE, NOPASS :: O0PSIMadeAMistake => oops
  END TYPE I
  TYPE, EXTENDS(Parent) :: J
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE J
  TYPE, EXTENDS(Parent) :: K
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE K
  TYPE, EXTENDS(Parent) :: L
  CONTAINS
    PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
  END TYPE L
CONTAINS
  SUBROUTINE oops
  END SUBROUTINE oops
END MODULE m

 

>ifort /check:all /warn:all /standard-semantics "2015-09-02 oops.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0 Build 20150815
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

2015-09-02 oops.f90: error #8322: A deferred binding is inherited by non-abstract type; It must be overridden.   [OOPSIMADEAMISTAKE]
compilation aborted for 2015-09-02 oops.f90 (code 1)


Ta.

0 Kudos
6 Replies
Steven_L_Intel1
Employee
925 Views

I must not have had enough coffee this morning - I can't spot the error. It looks to me as if all the extensions override the deferred binding. What am I overlooking?

As for location information, even if you have everything in the same program unit, the location points to the deferred binding which is not useful. I am sure we can do something better here, but I need to understand where the real problem is. Please help!

0 Kudos
Lorri_M_Intel
Employee
925 Views

Steve, I think that's Ian's point :-)

(Hint: Check the declaration of subroutine I ... carefully)

 

0 Kudos
mecej4
Honored Contributor III
925 Views

Gfortran gives the line number (47), but the error message itself still had me scratching my head and rubbing my eyes.  We need the help of a suitable font to see the problem.

 cat -n naughtyian.f90 | grep -C2 47
    45      PROCEDURE, NOPASS :: OOPSIMadeAMistake => oops
    46    END TYPE H
    47    TYPE, EXTENDS(Parent) :: I
    48    CONTAINS
    49      PROCEDURE, NOPASS :: O0PSIMadeAMistake => oops
                                  ^
                                  |
                                  |

 

0 Kudos
Steven_L_Intel1
Employee
925 Views

I understood Ian's point, my tired eyes didn't catch what the error was.

I'll definitely pass this on to the developers. Issue ID is DPD200375685.

0 Kudos
Steven_L_Intel1
Employee
925 Views

Ok, here's what the next major release will say:

U591282.f90: error #8322: A deferred binding is inherited by non-abstract type;
It must be overridden.   [OOPSIMADEAMISTAKE]
U591282.f90(47): error #6136: Derived-type declared must be ABSTRACT   
  TYPE, EXTENDS(Parent) :: I
---------------------------^

 

0 Kudos
IanH
Honored Contributor III
925 Views

W0nderful, thanks.

0 Kudos
Reply