6
以下犯规编译英特尔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.
谢谢!你介意解释,为什么这解决了我的问题? – 2011-03-31 18:12:05
没有明确指定'nopass'属性,组件自动具有'pass'属性(也可以明确指定)。这意味着过程的第一个伪参数应该与被定义的类型具有相同的类型(如错误消息中所述)。当引用procpointer组件时,通过它调用的对象会自动作为第一个参数传递。 – eriktous 2011-03-31 18:21:13
如果我想使用'pass'关键字,我将如何更改'interface1'? – 2011-05-04 10:46:13