File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ scope. Note that setting an option here will propagate its value across Julia
1313or Dagger tasks spawned by `f()` or its callees (i.e. the options propagate).
1414"""
1515function with_options (f, options:: NamedTuple )
16- with (options_context => options) do
16+ prev_options = options_context[]
17+ with (options_context => merge (prev_options, options)) do
1718 f ()
1819 end
1920end
Original file line number Diff line number Diff line change 5050 end
5151 end
5252
53+ # Test previous option preservation
54+ Dagger. with_options (scope= Dagger. scope (worker= last_wid)) do
55+ Dagger. with_options (meta= true ) do
56+ @test haskey (Dagger. get_options (), :meta )
57+ @test Dagger. get_options (:meta ) == true
58+ @test haskey (Dagger. get_options (), :scope )
59+ @test Dagger. get_options (:scope ) == Dagger. scope (worker= last_wid)
60+ end
61+ end
62+
5363 # Test scope/single is applied
5464 for wid in workers ()
5565 for (option, value) in [
You can’t perform that action at this time.
0 commit comments