@@ -141,6 +141,20 @@ async fn taking_collectibles_parallel() {
141
141
. unwrap ( )
142
142
}
143
143
144
+ #[ tokio:: test]
145
+ async fn taking_collectibles_with_resolve ( ) {
146
+ run ( & REGISTRATION , || async {
147
+ let result_op = my_transitive_emitting_function_with_resolve ( "resolve" . into ( ) ) ;
148
+ result_op. connect ( ) . strongly_consistent ( ) . await ?;
149
+ let list = result_op. take_collectibles :: < Box < dyn ValueToString > > ( ) ;
150
+ assert_eq ! ( list. len( ) , 2 ) ;
151
+
152
+ anyhow:: Ok ( ( ) )
153
+ } )
154
+ . await
155
+ . unwrap ( )
156
+ }
157
+
144
158
#[ turbo_tasks:: value( transparent) ]
145
159
struct Collectibles ( AutoSet < ResolvedVc < Box < dyn ValueToString > > > ) ;
146
160
@@ -225,6 +239,18 @@ async fn my_emitting_function(_key: RcStr) -> Result<()> {
225
239
Ok ( ( ) )
226
240
}
227
241
242
+ #[ turbo_tasks:: function]
243
+ async fn my_transitive_emitting_function_with_thing ( key : RcStr , _thing : Vc < Thing > ) -> Result < ( ) > {
244
+ let _ = my_emitting_function ( key) ;
245
+ Ok ( ( ) )
246
+ }
247
+
248
+ #[ turbo_tasks:: function( operation) ]
249
+ async fn my_transitive_emitting_function_with_resolve ( key : RcStr ) -> Result < ( ) > {
250
+ let _ = my_transitive_emitting_function_with_thing ( key, get_thing ( 0 ) ) ;
251
+ Ok ( ( ) )
252
+ }
253
+
228
254
#[ turbo_tasks:: value( shared) ]
229
255
struct Thing ( u32 ) ;
230
256
@@ -241,3 +267,8 @@ impl ValueToString for Thing {
241
267
Vc :: cell ( self . 0 . to_string ( ) . into ( ) )
242
268
}
243
269
}
270
+
271
+ #[ turbo_tasks:: function]
272
+ fn get_thing ( v : u32 ) -> Vc < Thing > {
273
+ Thing :: cell ( Thing ( v) )
274
+ }
0 commit comments