eta icon indicating copy to clipboard operation
eta copied to clipboard

Quasi-quote bug while building aeson-typescript

Open Jyothsnasrinivas opened this issue 6 years ago • 0 comments

While building aeson-typescript-0.1.1.0, I encountered a bug which may be related to Template Haskell.

[2 of 5] Compiling Data.Aeson.TypeScript.Instances
src/Data/Aeson/TypeScript/Instances.hs:76:28: error:
    Illegal data constructor name: ‘:: ’
    When splicing a TH expression:
      Data.String.fromString (GHC.Show.showString "{[k: " ((GHC.Show.showString GHC.Base.. Data.String.Interpolate.Internal.Util.toString) (getTypeScriptType (Proxy ::  Proxy a)) (GHC.Show.showString "]: " ((GHC.Show.showString GHC.Base.. Data.String.Interpolate.Internal.Util.toString) (getTypeScriptType (Proxy ::  Proxy b)) (GHC.Show.showString "}" "")))))
    In the quasi-quotation:
      [i|{[k: #{getTypeScriptType (Proxy :: Proxy a)}]: #{getTypeScriptType (Proxy :: Proxy b)}}|]
   |
76 |   getTypeScriptType _ = [i|{[k: #{getTypeScriptType (Proxy :: Proxy a)}]: #{getTypeScriptType (Proxy :: Proxy b)}}|]
   |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Jyothsnasrinivas avatar Aug 09 '18 15:08 Jyothsnasrinivas