Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Raw can only be the last #142

Open
domenkozar opened this issue Feb 20, 2019 · 0 comments
Open

Raw can only be the last #142

domenkozar opened this issue Feb 20, 2019 · 0 comments
Labels

Comments

@domenkozar
Copy link
Collaborator

diff --git a/servant-auth-server/test/Servant/Auth/ServerSpec.hs b/servant-auth-server/test/Servant/Auth/ServerSpec.hs
index f5047cd..22a1e60 100644
--- a/servant-auth-server/test/Servant/Auth/ServerSpec.hs
+++ b/servant-auth-server/test/Servant/Auth/ServerSpec.hs
@@ -398,8 +398,8 @@ type API auths
     = Auth auths User :>
         ( Get '[JSON] Int
        :<|> ReqBody '[JSON] Int :> Post '[JSON] Int
-       :<|> "header" :> Get '[JSON] (Headers '[Header "Blah" Int] Int)
        :<|> "raw" :> Raw
+       :<|> "header" :> Get '[JSON] (Headers '[Header "Blah" Int] Int)
         )
       :<|> "login" :> ReqBody '[JSON] User :> Post '[JSON] (Headers '[ Header "Set-Cookie" SetCookie
                                                                      , Header "Set-Cookie" SetCookie ] NoContent)
@@ -466,8 +466,9 @@ server ccfg =
     (\authResult -> case authResult of
         Authenticated usr -> getInt usr
                         :<|> postInt usr
-                        :<|> getHeaderInt
                         :<|> raw
+                        :<|> getHeaderInt
+
         Indefinite -> throwAll err401
         _ -> throwAll err403
     )

results into

    /home/ielectric/dev/servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs:455:26: error:
        * Overlapping instances for Servant.Auth.Server.Internal.AddSetCookie.AddSetCookies
                                      ('Servant.Auth.Server.Internal.AddSetCookie.S
                                         ('Servant.Auth.Server.Internal.AddSetCookie.S
                                            'Servant.Auth.Server.Internal.AddSetCookie.Z))
                                      (Tagged Handler Application
                                       :<|> Handler (Headers '[Header "Blah" Int] Int))
                                      (Tagged Handler Application
                                       :<|> Handler
                                              (Headers
                                                 '[Header "Set-Cookie" SetCookie,
                                                   Header "Set-Cookie" SetCookie, Header "Blah" Int]
                                                 Int))
            arising from a use of `serveWithContext'
          Matching instances:
            two instances involving out-of-scope types
            (use -fprint-potential-instances to see them all)
        * In the expression: serveWithContext api ctx
          In the expression: serveWithContext api ctx $ server ccfg
          In an equation for `appWithCookie':
              appWithCookie api ccfg
                = serveWithContext api ctx $ server ccfg
                where
                    ctx = ccfg :. jwtCfg :. theKey :. EmptyContext
        |
    455 | appWithCookie api ccfg = serveWithContext api ctx $ server ccfg
        |                          ^^^^^^^^^^^^^^^^^^^^^^^^

@domenkozar domenkozar added the bug label Feb 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant