From adf3bcb684ac1546d858b7e68eec29612d4fa88e Mon Sep 17 00:00:00 2001 From: Adriaan Leijnse Date: Wed, 15 Nov 2023 16:15:36 +0000 Subject: [PATCH] Error in DEBUG if inner propagated while coincidence occ was known --- src/Reflex/Spider/Internal.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Reflex/Spider/Internal.hs b/src/Reflex/Spider/Internal.hs index bd833ed2..a43ebde8 100644 --- a/src/Reflex/Spider/Internal.hs +++ b/src/Reflex/Spider/Internal.hs @@ -535,10 +535,12 @@ newSubscriberCoincidenceOuter subscribed = debugSubscriber ("SubscriberCoinciden newSubscriberCoincidenceInner :: forall x a. HasSpiderTimeline x => CoincidenceSubscribed x a -> IO (Subscriber x a) newSubscriberCoincidenceInner subscribed = debugSubscriber ("SubscriberCoincidenceInner" <> showNodeId subscribed) $ Subscriber { subscriberPropagate = \a -> {-# SCC "traverseCoincidenceInner" #-} do +#ifdef DEBUG occ <- liftIO $ readIORef $ coincidenceSubscribedOccurrence subscribed case occ of - Just _ -> return () -- SubscriberCoincidenceOuter must have already propagated this event + Just _ -> error "Coincidence inner is propagating, but coincidence occurrence is already known?" Nothing -> do +#endif liftIO $ writeIORef (coincidenceSubscribedOccurrence subscribed) $ Just a scheduleClear $ coincidenceSubscribedOccurrence subscribed propagate a $ coincidenceSubscribedSubscribers subscribed