以下内容无法在英特尔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
错误:
error #8262: The passed-object dummy argument must be dummy data object with the same declared type as the type being defined.
答案 0 :(得分:8)
将nopass
属性添加到过程指针组件的声明中。
procedure(interface1), pointer, nopass :: p
编辑:为了回应你的评论,如果你想使用pass关键字,那么必须改变界面:
ABSTRACT INTERFACE integer function interface1(passed_object, a) import :: type1 class(type1), intent(...) :: passed_object real, intent(in) :: a END function interface1 END INTERFACE