This was a feature I didn't realize existed so I need to support it eventually. I'm not sure if procedures can appear anywhere else but I should try and check.
References:
module m
type myclass
contains
procedure, nopass :: static_method ! static method
procedure, pass :: instance_method ! instance method
end type myclass
contains
subroutine static_method(arg)
integer :: arg
! code to implement method goes here
end subroutine static_method
subroutine instance_method(this,arg)
! "this" refers to the instance of the class
class(myclass) :: this
integer :: arg
! code to implement method goes here
end subroutine instance_method
end module m
This was a feature I didn't realize existed so I need to support it eventually. I'm not sure if procedures can appear anywhere else but I should try and check. References:
Generic procedure ref inside dervied types: