[GHC] #13838: -Wdeferred-type-errors; ghc: panic!; VoidRep; ((() -> ()) :: *) ~# (IO Any :: *)

GHC ghc-devs at haskell.org
Fri Jun 23 19:45:13 UTC 2017


#13838: -Wdeferred-type-errors; ghc: panic!; VoidRep; ((() -> ()) :: *) ~# (IO Any
:: *)
-------------------------------------+-------------------------------------
        Reporter:  harry             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             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:                    |
-------------------------------------+-------------------------------------

Comment (by harry):

 Although my distro ships version 8.0.2 now I still get a "ghc: panic! (the
 'impossible' happened)" with this slightly more complex code but within
 ghci only:

 With "ghci -fdefer-type-errors" and this code:

 {{{#!hs
 bad1 :: [()]
 bad1 = num

 bad2 :: ()
 bad2 = num

 num = 9
 }}}

 the output:
 {{{
 GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
 Prelude> :l ghc_bug_2.hs
 [1 of 1] Compiling Main             ( ghc_bug_2.hs, interpreted )

 ghc_bug_2.hs:2:8: warning: [-Wdeferred-type-errors]
     * Couldn't match expected type `[()]' with actual type `()'
     * In the expression: num
       In an equation for `bad1': bad1 = num
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.2 for x86_64-unknown-linux):
         corePrepPgm
   [False] cobox_r196 = typeError
                          @ 'VoidRep
                          @ (() :: *) ~# ([()] :: *)
                          "ghc_bug_2.hs:2:8: error:\n\
                          \    * Couldn't match expected type `[()]' with
 actual type `()'\n\
                          \    * In the expression: num\n\
                          \      In an equation for `bad1': bad1 = num\n\
                          \(deferred type error)"#

 Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

 >
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13838#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list