Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Procedure Pointer, Derived Type

The following doesnt compile in Intel Fortran XE 2011:

TYPE type1
    procedure(interface1),POINTER::p
END TYPE type1

ABSTRACT INTERFACE 
    integer function interface1(a)
        real,intent(in)::a    
    END function interface1
END INTERFACE

The error:

error #8262: The passed-object dummy argument must be dummy data object with the same declared type as the type being defined.
like image 453
Johannes Gerer Avatar asked Mar 31 '11 15:03

Johannes Gerer


1 Answers

Add the nopass attribute to the declaration of the procedure pointer component.

procedure(interface1), pointer, nopass :: p

Edit: In response to your comment, if you want to use the pass keyword, the interface would have to be changed as such:

ABSTRACT INTERFACE 
    integer function interface1(passed_object, a)
        import :: type1
        class(type1), intent(...) :: passed_object
        real,         intent(in)  :: a
    END function interface1
END INTERFACE
like image 118
eriktous Avatar answered Sep 28 '22 09:09

eriktous