[GHC] #8987: TH: panic in reportWarning when the message throws an exception
GHC
ghc-devs at haskell.org
Mon Apr 14 11:54:34 UTC 2014
#8987: TH: panic in reportWarning when the message throws an exception
---------------------------------------+-----------------------------------
Reporter: Yuras | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: Compile-time crash | Unknown/Multiple
Test Case: | Difficulty: Unknown
Blocking: | Blocked By:
| Related Tickets:
---------------------------------------+-----------------------------------
Comment (by Yuras):
Replying to [comment:2 simonpj]:
> I have not thought about this deeply, but wouldn't something very
similar happen with your change? The program will still crash, won't it?
No, ghc is prepared for exceptions in splice, including nested exceptions.
See Note [Exceptions in TH] and Note [Concealed TH exceptions]
So with my change compilation gracefully fails with the next message:
{{{
main.hs:1:1:
Exception when trying to run compile-time code:
Prelude.undefined
Code: test
}}}
>
> Would you like to give a test case?
>
> In any case, you are right that if you are going to do this at all, then
something deepseq-like would be more thorough.
>
> By all means send a patch (with comments to explain). Thanks.
Well, looks like it is not possible to use `deepseq` in `ghc`. Should I
implement ad-hoc solution? Something like `deepseqString`? I don't believe
it is the first time we need `deepseq`, so most likely it is already
implemented somewhere.
Thanks,
Yuras
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8987#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list