[GHC] #14893: GHC hangs while producing error message for incorrect TypeFamilies application

#14893: GHC hangs while producing error message for incorrect TypeFamilies application -------------------------------------+------------------------------------- Reporter: coopercm | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Linux Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Here's a minimally reproducible example: {{{#!hs {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} module Main where newtype Token f a = Token { unToken :: f a } class Class x (f :: * -> *) where type Meta x f :: * type Body x f :: * type Body x f = Token f Meta main :: IO () main = return () }}} This hangs like so {{{ [2 of 2] Compiling Main ( app/Main.hs, .stack- work/dist/x86_64-linux/Cabal-2.0.1.0/build/foo-exe/foo-exe-tmp/Main.o ) }}} I tested on 8.2.2 and 8.0.2 and got the same behavior. The closest existing bug report I could find was https://ghc.haskell.org/trac/ghc/ticket/12386. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14893 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14893: GHC hangs while producing error message for incorrect TypeFamilies application -------------------------------------+------------------------------------- Reporter: coopercm | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #12386 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #12386 Comment: Thanks for the bug report. I believe this is in fact a duplicate of #12386, as this gives a proper error on GHC 8.4.1: {{{ $ /opt/ghc/8.4.1/bin/ghci Bug.hs GHCi, version 8.4.0.20180224: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Main ( Bug.hs, interpreted ) Bug.hs:11:27: error: • Expecting two more arguments to ‘Meta’ Expected a type, but ‘Meta’ has kind ‘* -> (* -> *) -> *’ • In the second argument of ‘Token’, namely ‘Meta’ In the type ‘Token f Meta’ In the default type instance declaration for ‘Body’ | 11 | type Body x f = Token f Meta | ^^^^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14893#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14893: GHC hangs while producing error message for incorrect TypeFamilies application -------------------------------------+------------------------------------- Reporter: coopercm | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: duplicate | Keywords: Operating System: Linux | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #12386 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by coopercm): Thanks! Looking forward to the release of 8.4.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14893#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC