We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1af57c5 commit 8916dd3Copy full SHA for 8916dd3
base/task.jl
@@ -180,11 +180,20 @@ end
180
elseif field === :exception
181
# TODO: this field name should be deprecated in 2.0
182
return t._isexception ? t.result : nothing
183
+ elseif field === :scope
184
+ error("Querying `scope` is disallowed. Use `current_scope` instead.")
185
else
186
return getfield(t, field)
187
end
188
189
190
+@inline function setproperty!(t::Task, field::Symbol, @nospecialize(v))
191
+ if field === :scope
192
+ istaskstarted(t) && error("Setting scope on a started task directly is disallowed.")
193
+ end
194
+ return @invoke setproperty!(t::Any, field, v)
195
+end
196
+
197
"""
198
istaskdone(t::Task) -> Bool
199
0 commit comments