Учитывая следующий код
type t1
integer :: dum
type(aop), alloctable :: bc(:)
end type t1
type aop
procedure(A_INT), pass(t1), pointer :: ptr => null()
end type aop
abstract interface
subroutine A_INT ( this )
import t1
class(t1) , intent(in) :: this
end subroutine
end interface
Может кто-нибудь объяснить, почему это незаконно?По крайней мере, компилятор говорит,
error #8170: The passed-object dummy argument is missing from the procedure interface. [A_INT]
procedure(A_INT), pass(t1),
-------------------^
ОБНОВЛЕНО
Когда я делаю это вместо
type t1
integer :: dum
type(aop), alloctable :: bc(:)
end type t1
type aop
procedure(A_INT), pass(this), pointer :: ptr => null()
end type aop
abstract interface
subroutine A_INT ( this )
import t1
class(t1) , intent(in) :: this
end subroutine
end interface
Я получаю следующую ошибку
error #8262: For a type-bound procedure that has the PASS binding attribute, the first dummy argument must have the same declared type as the type being defined. [THIS]
subroutine A_INT( this
что, по-моему, означает, что компилятор ожидает, что первый аргумент будет иметь тип aop
?Разве невозможно иметь this
типа t1
? 1020 *