Opened 3 years ago

Closed 3 years ago

#5358 closed bug (fixed)

Exotic form of kind ghc-prim:GHC.Prim.?{(w) tc 34g}

Reported by: alios Owned by:
Priority: normal Milestone: 7.4.1
Component: Template Haskell Version: 7.0.4
Keywords: Cc:
Operating System: Linux Architecture: x86
Type of failure: None/Unknown Difficulty:
Test Case: th/T5358 Blocked By:
Blocking: Related Tickets:

Description

with this code here:

https://gist.github.com/1115357

I was able to produce this panic in ghci:

/home/alios/tmp/foo.hs:19:12:ghc: panic! (the 'impossible' happened)
  (GHC version 7.0.4 for i386-unknown-linux):
	Exotic form of kind ghc-prim:GHC.Prim.?{(w) tc 34g}

Change History (4)

comment:1 Changed 3 years ago by igloo

  • Component changed from Compiler to Template Haskell
  • Milestone set to 7.4.1

Thanks for the report. Here's a testcase:

{-# LANGUAGE TemplateHaskell #-}

import Language.Haskell.TH

t1, t2 :: Int
t1 x = x
t2 x = x

prop_x1 x = t1 x == t2 x

runTests = $( do VarI _ t _ _ <- reify (mkName "prop_x1")
                 error $ pprint t
            )
$ ghci q.hs
GHCi, version 7.3.20110729: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main             ( q.hs, interpreted )
Loading package pretty-1.1.0.0 ... linking ... done.
Loading package array-0.3.0.3 ... linking ... done.
Loading package containers-0.4.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.

q.hs:6:1:
    The equation(s) for `t1' have one argument,
    but its type `Int' has none

q.hs:7:1:
    The equation(s) for `t2' have one argument,
    but its type `Int' has none

q.hs:9:13:
    The function `t1' is applied to one argument,
    but its type `Int' has none
    In the first argument of `(==)', namely `t1 x'
    In the expression: t1 x == t2 x
    In an equation for `prop_x1': prop_x1 x = t1 x == t2 x

q.hs:11:15:ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.3.20110729 for x86_64-unknown-linux):
        Exotic form of kind ghc-prim:GHC.Prim.?{(w) tc 34g}

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

comment:2 Changed 3 years ago by simonpj@…

commit 0cda0606f53bc6141ac90b00ef814e66795e7da6

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Mon Aug 1 15:23:02 2011 +0100

    Don't run a splice if there are preceding type errors
    
    Fixes Trac #5358.

 compiler/typecheck/TcSplice.lhs |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

comment:3 Changed 3 years ago by simonpj

  • Status changed from new to merge
  • Test Case set to th/T5358

Fixed, by the above patch. Thank you very much for reporting this so nicely.

Simon

comment:4 Changed 3 years ago by igloo

  • Resolution set to fixed
  • Status changed from merge to closed
Note: See TracTickets for help on using tickets.