File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -166,10 +166,20 @@ function Base.copy(t::TapedTask; args=())
166166 error (" can't copy started task with new arguments" )
167167 tf = copy (t. tf)
168168 task_args = if length (args) > 0
169+ # this cond implies t.tf.counter == 0, i.e., the task is not started yet
169170 typeof (args) == typeof (t. args) || error (" bad arguments" )
170171 args
171172 else
172- tape_copy .(t. args)
173+ if t. tf. counter > 1
174+ # the task is running, we find the
175+ # real args from the copied bindings
176+ map (1 : length (t. args)) do i
177+ get (tf. bindings, Symbol (" _" , i + 1 ), t. args[i])
178+ end
179+ else
180+ # the task is not started yet, but no args is given
181+ tape_copy .(t. args)
182+ end
173183 end
174184 new_t = TapedTask (tf, task_args... )
175185 storage = t. task. storage:: IdDict{Any,Any}
You can’t perform that action at this time.
0 commit comments