File tree 2 files changed +12
-1
lines changed
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
13
13
or Dagger tasks spawned by `f()` or its callees (i.e. the options propagate).
14
14
"""
15
15
function 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
17
18
f ()
18
19
end
19
20
end
Original file line number Diff line number Diff line change 50
50
end
51
51
end
52
52
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
+
53
63
# Test scope/single is applied
54
64
for wid in workers ()
55
65
for (option, value) in [
You can’t perform that action at this time.
0 commit comments