I am trying to use the following defined function to calculate "Reserve" variable.
The detailed of the codes are in the link below. (Except the code I put here, other coding runs perfectly).
I have figure out that is Benefit(0:n) and Benefit(0:last(age_mortality)) led the error. However, my purpose is that I can get a vector start from 0 to n
Anyone know how can I fix this?
(This code shows from line 181 shown in the github file)