String literals are not escaped in -ddump-splices
For example, with this code:
Main.hs
:
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -ddump-splices -ddump-to-file #-}
module Main where
main :: IO ()
main = do
putStrLn $( [| "\n\n\n" |] )
putStrLn $( [| "\"" |] )
This is output:
Main.dump-splices
:
Main.hs:8:15-28: Splicing expression [| "\n\n\n" |] ======> "
"
Main.hs:9:15-24: Splicing expression [| "\"" |] ======> """
… which is not valid Haskell.
Trac metadata
Trac field | Value |
---|---|
Version | 8.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |