
#11220: Stack overflow instead of type check failure in Servant route -------------------------------------+------------------------------------- Reporter: sopvop | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 (Type checker) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC 7.10.3 eats a lot of memory and segfaults compiling this. {{{#!hs {-# LANGUAGE DataKinds #-} {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE TypeOperators #-} module Main where import Data.Proxy import Servant.API -- requires servant data A apiP :: Proxy Api apiP = Proxy -- Users type Api = "variants" :> Get '[JSON] () routeL :: URI routeL = safeLink apiP (Proxy :: Proxy ("variants" :> Get '[A] ())) -- Should result in type error -- '[JSON] in route but '[A] here main = print routeL }}} There is '[ JSON ] in Api type, but '[A] in Proxy type passed to safeLink, so it should result in type error. Correct program compiles without problems. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11220 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler