#5255: String literals cause runtime crashes when OverloadedStrings is in effect
---------------------------------+------------------------------------------
Reporter: YitzGale | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.0.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by cdsmith):
Just copying this from elsewhere. I'm not necessarily in favor of this
idea, but I think it would be a valid, semantics-preserving transformation
to have the compiler speculatively try to evaluate string (and numeric,
for that matter) literals at compile time, and just give up if:
* The code ran for too long.
* The code used unsafePerformIO or something similar.
At its root, this would be nothing more than an optimization -- evaluating
a complex expression at compile time. But there could be a warning for
cases when you gave up due to the computation taking too long or doing
unsafePerformIO tricks, or where it's known that the literal is bottom.
I'm not saying I think we *should* do this. But I'm saying I think it
would beat adding another order of magnitude of complexity to the
semantics of literals by making them depend on TH and quasiquoting.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5255#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs