当我尝试在一种抽象类型中混合常规过程和延迟过程时,gfortran 对常规过程的任何调用都犹豫不决:“错误:(1) 处的类型绑定过程调用的基础对象是抽象类型‘tbody’”
type, abstract :: tBody
private
...
contains
procedure :: init => new_Body
...
procedure (contained), deferred :: PointIn
end type tBody
abstract interface
logical(LGT) pure function contained( Body, Point )
import :: tBody, tAffinePoint, LGT
class(tBody), intent(IN) :: Body
type(tAffinePoint), intent(IN) :: Point
end function contained
end interface
subroutine newCuboid( this, ... )
class(tCuboid), intent(OUT) :: this
...
call this%tBody%init( ... )
.... [gfortran halts here]
end subroutine newCuboid
有没有办法安排类型 tBody 以便我可以同时拥有抽象的延迟过程和常规的实例化过程?