Opened 2 years ago

Closed 2 years ago

#5597 closed bug (fixed)

Quoting a type in a splice dies with "Evaluated place holder for PostTcKind"

Reported by: benl Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 7.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash Difficulty:
Test Case: th/T5597 Blocked By:
Blocking: Related Tickets:

Description

Compiling the following with the current head:

{-# LANGUAGE TemplateHaskell #-}
$(undefined [t| (Int, Int) |])
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.3.20111031 for i386-apple-darwin):
	Evaluated the place holder for a PostTcKind

Note that the 'undefined' isn't the problem. I've just used that as the splice function for debugging purposes. Changing the tuple to a single Int gives the expected result:

{-# LANGUAGE TemplateHaskell #-}
$(undefined [t| Int |])
Main.hs:1:1:
    Exception when trying to run compile-time code:
      Prelude.undefined
      Code: undefined [t| Int |]

Change History (3)

comment:1 Changed 2 years ago by benl

I'll add that this works in GHC 7.2.1, and was working in the head within about six weeks ago.

comment:2 Changed 2 years ago by simonpj@…

commit 402a1daa1ec30b523b256df8705add8843e901bc

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Thu Nov 17 13:14:14 2011 +0000

    Make DsMeta work right on tuples (cf Trac #5597)

 compiler/deSugar/DsMeta.hs |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

comment:3 Changed 2 years ago by simonpj

  • Resolution set to fixed
  • Status changed from new to closed
  • Test Case set to th/T5597

Happily this is now fixed as a result of Pedros work. test added.

Note: See TracTickets for help on using tickets.