[GHC] #14616: panic! initTc: unsolved constraints

GHC ghc-devs at haskell.org
Mon Dec 25 20:15:39 UTC 2017


#14616: panic! initTc: unsolved constraints
-------------------------------------+-------------------------------------
           Reporter:  w-j-w          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:                 |  Operating System:  Linux
       Architecture:  x86_64         |   Type of failure:  Compile-time
  (amd64)                            |  crash or panic
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 New haskeller here,
 I was doing an exercise at http://exercism.io/exercises/haskell
 /rotational-cipher/readme and got the following error message from the
 compiler.

 {{{
 Compiling Main             ( RotationalCipher.hs, .stack-work/dist/x86_64
 -linux-tinfo6/Cabal-1.24.2.0/build/Main.o )
 ghc: panic! (the 'impossible' happened)
   (GHC version 8.0.2 for x86_64-unknown-linux):
         initTc: unsolved constraints
   WC {wc_insol =
         [W] find_a7hU :: t_a7hT[tau:1] (CHoleCan: find)
         [W] find_a7iF :: t_a7iE[tau:1] (CHoleCan: find)}

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

 Progress: 16/17
 --  While building custom Setup.hs for package rotational-cipher-1.1.0.1
 using:
       /home/websterw/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-
 simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64
 -linux-tinfo6/Cabal-1.24.2.0 build lib:rotational-cipher test:test --ghc-
 options " -ddump-hi -ddump-to-file"
     Process exited with code: ExitFailure 1
 }}}

 I was using the normal project setup that exercism uses for this problem,
 with my code residing a file called `RotationalCipher.hs`. The contents of
 this file are as follows.

 {{{
 rotate :: Int -> String -> String
 rotate n = map (rot n)

 rot :: Int -> Char -> Char
 rot i c
   | c `elem` ['a'..'z'] = let translate = zip (lowershift n) ['a'..'z'] in
       fst (find (\x -> snd x == c) translate)
   | c `elem` ['A'..'Z'] = let translate = zip (uppershift n) ['A'..'Z'] in
       fst (find (\x -> snd x == c) translate)
   | otherwise = c
   where lowershift n = take 26 $ drop n $ cycle ['a'..'z']
         uppershift n = take 26 $ drop n $ cycle ['A'..'Z']
 }}}

 The error occured when I ran `stack test`

 I am using fedora linux as my operating system on x86_64

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


More information about the ghc-tickets mailing list