Ticket #1788 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

panic with Template Haskell splicing/quoting

Reported by: guest Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

I got a panic when quoting a name in some qualified module. The demonstration code is at  http://hpaste.org/3380. See  http://hpaste.org/3380/diff?old=1&new=2 for the diff between the panicky and non-panicky versions.

This looks very similar to bug #1755, but shachaf in #haskell says it affects GHC 6.9.20071012.

#haskell discussion log, search for 'panic' around 00:29:  http://ircbrowse.com/channel/haskell/20071019

-- Nicholas Messenger (nmessenger@…, omnId on #haskell)

Change History

Changed 6 years ago by guest

19:43 <!shachaf> omnId: In GHC 6.9.20071012, I get: FRef.hs:97:32: Stage error: the non-top-level quoted name 'ref must be used at the same stage at which is is bound

Changed 6 years ago by simonpj

Indeed, this line in FRef looks wrong

    -- Names to be used in code generation.
    let [ref,refClass,val,s] = ['ref, ''Ref, mkName "val", mkName "s"]

I don't know what you were trying to do, but the 'ref is binding to the ref on the LHS of this (recursive!) definition. As schchaf says, the HEAD (and the branch now, since Ian has merged the fix) gives a more helpful message.

If that all seems right when you've checked it out, can you close the bug? Thanks for taking the time to report it.

Simon

Changed 6 years ago by guest

  • status changed from new to closed
  • resolution set to fixed

Oh, crud, it is wrong. That was dumb of me. Sorry about that.

I'm working with extremely sketchy knowledge of TH, anyway. I don't know the rules of what quoted names resolve to but that was just a silly newb mistake.

I also misinterpreted what shachaf said, simply because I didn't understand what he said. :)

Right, closed.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.