[GHC] #14082: -ddump-json does not escape output properly
GHC
ghc-devs at haskell.org
Thu Aug 3 01:56:34 UTC 2017
#14082: -ddump-json does not escape output properly
-------------------------------------+-------------------------------------
Reporter: dramforever | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.1
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
== Steps to reproduce
This program
{{{#!hs
module StringError where
q = "string" + "string"
}}}
Compiled with `-ddump-json`, produces this JSON output:
{{{
[
{"span": {"file": "tmp.hs","startLine": 3,"startCol": 5,"endLine":
3,"endCol": 24},"doc": "\u2022 No instance for (Num [Char]) arising f
rom a use of \u2018+\u2019\n\u2022 In the expression: "string" +
"string"\n In an equation for \u2018q\u2019: q = "string" + "string"","
severity": "SevError","reason": null}]
}}}
It is not valid JSON, because `"string"` occured in a JSON string, but the
quotes are not escaped.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14082>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list