From c7e4dd0a1cd9ec9e36a5efe8b87f2e09066cc653 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 22 Jan 2019 18:40:15 +0200 Subject: [PATCH] Fix test suite compilation on GHC 8.6.3 commercialhaskell/stackage#4319 --- yesod-core/ChangeLog.md | 4 ++++ yesod-core/test/YesodCoreTest/Cache.hs | 10 ++++++++-- yesod-core/yesod-core.cabal | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/yesod-core/ChangeLog.md b/yesod-core/ChangeLog.md index 8476321c..a1e2946e 100644 --- a/yesod-core/ChangeLog.md +++ b/yesod-core/ChangeLog.md @@ -1,5 +1,9 @@ # ChangeLog for yesod-core +## 1.6.10.1 + +* Fix test suite compilation for [commercialhaskell/stackage#4319](https://github.com/commercialhaskell/stackage/issues/4319) + ## 1.6.10 * Adds functions to get and set values in the per-request caches. [#1573](https://github.com/yesodweb/yesod/pull/1573) diff --git a/yesod-core/test/YesodCoreTest/Cache.hs b/yesod-core/test/YesodCoreTest/Cache.hs index 846544a1..7320c114 100644 --- a/yesod-core/test/YesodCoreTest/Cache.hs +++ b/yesod-core/test/YesodCoreTest/Cache.hs @@ -47,7 +47,10 @@ getRootR = do V2 v2b <- cached $ atomicModifyIORef ref $ \i -> (i + 1, V2 $ i + 1) cacheBySet "3" (V2 3) - Just (V2 v3a) <- cacheByGet "3" + V2 v3a <- cacheByGet "3" >>= \x -> + case x of + Just y -> return y + Nothing -> error "must be Just" V2 v3b <- cachedBy "3" $ (pure $ V2 4) return $ RepPlain $ toContent $ show [v1a, v1b, v2a, v2b, v3a, v3b] @@ -66,7 +69,10 @@ getKeyR = do cacheBySet "4" (V2 4) - Just (V2 v4a) <- cacheByGet "4" + V2 v4a <- cacheByGet "4" >>= \x -> + case x of + Just y -> return y + Nothing -> error "must be Just" V2 v4b <- cachedBy "4" $ (pure $ V2 5) return $ RepPlain $ toContent $ show [v1a, v1b, v2a, v2b, v3a, v3b, v4a, v4b] diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index a4762587..fe523873 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.6.10 +version: 1.6.10.1 license: MIT license-file: LICENSE author: Michael Snoyman