Ticket #5126 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

Splicing a type into a signature decl within a decl quotation panics with "mkUsageInfo: internal name? x2{v a2pX}"

Reported by: FSalad Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 7.0.3
Keywords: quotation Cc: danlex@…
Operating System: Linux Architecture: x86
Type of failure: Compile-time crash Difficulty:
Test Case: th/T5126 Blocked By:
Blocking: Related Tickets:

Description

Hello,

trying to compile the attached file gives:

[1 of 1] Compiling THUtil           ( THUtil.hs, THUtil.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.0.3 for i386-unknown-linux):
        mkUsageInfo: internal name? x2{v a1Jh}

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

Attachments

BugReport.hs Download (1.3 KB) - added by FSalad 2 years ago.

Change History

Changed 2 years ago by FSalad

Changed 2 years ago by FSalad

  • cc danlex@… added

Changed 2 years ago by FSalad

  • summary changed from The 'impossible' happened: "mkUsageInfo: internal name? x2{v a2pX}" to Splicing a type into a signature decl within a decl quotation panics with "mkUsageInfo: internal name? x2{v a2pX}"

Nevermind the attached code; I minimized it down to:

{-# LANGUAGE TemplateHaskell #-}
module THUtil where

import Language.Haskell.TH
import Language.Haskell.TH.Syntax

f :: DecsQ
f = 
    [d| 
        x2 :: $(conT ''Int)
        x2 = undefined
    |]

Changed 2 years ago by simonpj

  • status changed from new to closed
  • testcase set to th/T5126
  • resolution set to fixed

Thanks! Fixed by

commit 620410fed8ee6169ccdfd5d7f914433319b29ae8
Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Wed Apr 20 17:15:38 2011 +0100

    Fix Trac #5126: generate correct usage info in TH declaration quotes
    
    In RnBinds.rnValBindsRHS I had
          (sig_dus `plusDU` bind_dus)
    when it should be
          (bind_dus `plusDU` sig_dus)
    
    So the fix is easy.

 compiler/rename/RnBinds.lhs |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
Note: See TracTickets for help on using tickets.