File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -775,9 +775,9 @@ var Aff = function () {
775
775
if ( tmp ) {
776
776
tmp = false ;
777
777
} else if ( tail === null ) {
778
- join ( step , null , null ) ;
778
+ join ( fail , null , null ) ;
779
779
} else {
780
- join ( step , tail . _1 , tail . _2 ) ;
780
+ join ( fail , tail . _1 , tail . _2 ) ;
781
781
}
782
782
} ;
783
783
} ) ;
Original file line number Diff line number Diff line change @@ -631,6 +631,26 @@ test_regression_return_fork = assert "regression/return-fork" do
631
631
(const (pure unit))
632
632
(const (pure true ))
633
633
634
+ test_regression_par_apply_async_canceler ∷ Aff Unit
635
+ test_regression_par_apply_async_canceler = assert " regression/par-apply-async-canceler" do
636
+ ref ← newRef " "
637
+ let
638
+ action1 = makeAff \_ →
639
+ pure $ Canceler \_ → do
640
+ delay (Milliseconds 10.0 )
641
+ void $ modifyRef ref (_ <> " done" )
642
+
643
+ action2 = do
644
+ delay (Milliseconds 5.0 )
645
+ void $ modifyRef ref (_ <> " throw" )
646
+ throwError (error " Nope." )
647
+
648
+ catchError
649
+ (sequential (parallel action1 *> parallel action2))
650
+ \err -> do
651
+ val <- readRef ref
652
+ pure (val == " throwdone" && message err == " Nope." )
653
+
634
654
main ∷ Effect Unit
635
655
main = do
636
656
test_pure
@@ -676,3 +696,4 @@ main = do
676
696
-- test_scheduler_size
677
697
test_parallel_stack
678
698
test_regression_return_fork
699
+ test_regression_par_apply_async_canceler
You can’t perform that action at this time.
0 commit comments