-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
I faced a problem with a sub-class of timedelta.
I defined a generic procedure name for operator(+) (as below, can be compiled),
but the program executes the operator for TimeDelta, not for RelativeDelta.
type, extends(TimeDelta) :: RelativeDelta
***
end type RelativeDelta
interface operator(+)
module procedure datetime_plus_relativedelta
module procedure relativedelta_plus_datetime
end interface operator(+)
One possible reason is class in the original datetime_plus_timedelta function.
While type(timedelta) indicates only timedelta class, class(timedelta) does sub-classes in addition to timedelta class.
pure elemental function datetime_plus_timedelta(d0,t) result(d)
class(datetime), intent(in) :: d0 !! `datetime` instance
class(timedelta),intent(in) :: t !! `timedelta` instance
Could you update the attribute from class to type in non-method procedures?
Or what can I do for overloading of such a function?
I will appreciate your help with this issue.
Metadata
Metadata
Assignees
Labels
No labels