隐式无 - 显式类型 - 抽象接口 - 错误
以下 Fortran 代码:
module Mod
implicit none
TYPE derivedtype
procedure(procInterface),POINTER,PASS::f
END TYPE derivedtype
ABSTRACT INTERFACE
subroutine procInterface(A)
import derivedtype
implicit none
class(derivedtype),intent(inout)::A
end subroutine
END INTERFACE
end module Mod
如果使用 ifort 编译,则会产生错误:
错误 #6404:此名称没有类型,并且必须具有显式类型。 [F]
为什么?这是一个错误吗?
The following Fortran Code:
module Mod
implicit none
TYPE derivedtype
procedure(procInterface),POINTER,PASS::f
END TYPE derivedtype
ABSTRACT INTERFACE
subroutine procInterface(A)
import derivedtype
implicit none
class(derivedtype),intent(inout)::A
end subroutine
END INTERFACE
end module Mod
produces an error if compiled with ifort:
error #6404: This name does not have a type, and must have an explicit type. [F]
Why? Is this a bug?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是编译器的缺点。 Cray 和 IBM 编译器也可以编译此特定模块,如 gfortran 4.6.1。根据您想要实现的目标,您也许可以使用通用类型绑定过程,但我不确定英特尔编译器是否能更好地支持这一点。
This is propably a compiler short-coming. The Cray and IBM compilers can compile this specific module as well, as gfortran 4.6.1. Depending on what you want to achieve, you maybe could use generic type-bound procedures instead, however I am unsure, if this would be better supported by the Intel compiler.