
#11220: Stack overflow instead of type check failure in Servant route -------------------------------------+------------------------------------- Reporter: sopvop | Owner: Type: bug | Status: new Priority: high | Milestone: 8.0.1 Component: Compiler (Type | Version: 7.10.3 checker) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): You have this definition: {{{ type family IsSubList a b :: Constraint where IsSubList '[] b = () IsSubList '[x] (x ': xs) = () IsSubList '[x] (y ': ys) = IsSubList '[x] ys IsSubList (x ': xs) y = IsSubList '[x] y `And` IsSubList xs y }}} But `IsSubList '[Int] '[]` loops by triggering the fourth equation (and being apart from all previous ones). Note that the left conjunct of the `And` is the exact same thing that we started with. So I think GHC's behavior here is quite reasonable. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11220#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler