[GHC] #13510: GHC panic with -fdefer-type-errors

#13510: GHC panic with -fdefer-type-errors -------------------------------------+------------------------------------- Reporter: chrismwendt | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This program causes GHCi to panic: {{{ import Data.Monoid a = "" x :: () -> Int x b = a <> b }}} {{{ $ stack --version Version 1.3.2 x86_64 hpack-0.15.0 $ stack exec ghci program.hs GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /Users/chrismwendt/.ghci [1 of 1] Compiling Main ( program.hs, interpreted ) program.hs:6:12: warning: [-Wdeferred-type-errors] • Couldn't match expected type ‘Int’ with actual type ‘()’ • In the second argument of ‘(<>)’, namely ‘b’ In the expression: a <> b In an equation for ‘x’: x b = a <> b ghc: panic! (the 'impossible' happened) (GHC version 8.0.2 for x86_64-apple-darwin): corePrepPgm [False] cobox_r1MZ = typeError @ 'VoidRep @ (Int :: *) ~# (() :: *) "program.hs:6:12: error:\n\ \ \\226\\128\\162 Couldn't match expected type \\226\\128\\152Int\\226\\128\\153 with actual type \\226\\128\\152()\\226\\128\\153\n\ \ \\226\\128\\162 In the second argument of \\226\\128\\152(<>)\\226\\128\\153, namely \\226\\128\\152b\\226\\128\\153\n\ \ In the expression: a <> b\n\ \ In an equation for \\226\\128\\152x\\226\\128\\153: x b = a <> b\n\ \(deferred type error)"# }}} Here's my ~/.ghci config: {{{ :set -fdefer-type-errors :set -XOverloadedStrings :set +t }}} Both -fdefer-type-errors and -XOVerloadedStrings are necessary to cause the panic. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13510 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13510: GHC panic with -fdefer-type-errors -------------------------------------+------------------------------------- Reporter: chrismwendt | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.2 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: #13292 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #13292 Comment: Thanks for the bug report. This panic no longer occurs in GHC 8.2 or HEAD, which makes me believe it's a duplicate of #13292, so I'll close this ticket as such. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13510#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC