Skip to content

Commit 1cecf7d

Browse files
authored
Forbid to copy started task with new args (TuringLang#143)
1 parent c7bac76 commit 1cecf7d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/tapedtask.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ Base.IteratorEltype(::Type{<:TapedTask}) = Base.EltypeUnknown()
162162
# copy the task
163163

164164
function Base.copy(t::TapedTask; args=())
165+
length(args) > 0 && t.tf.counter >1 &&
166+
error("can't copy started task with new arguments")
165167
tf = copy(t.tf)
166168
task_args = if length(args) > 0
167169
typeof(args) == typeof(t.args) || error("bad arguments")

0 commit comments

Comments
 (0)