Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeApplication on a TH-splice gets AST-clobbered #613

Closed
infinity0 opened this issue Jun 14, 2020 · 0 comments · Fixed by #616
Closed

TypeApplication on a TH-splice gets AST-clobbered #613

infinity0 opened this issue Jun 14, 2020 · 0 comments · Fixed by #616
Assignees
Labels
bug Something isn't working

Comments

@infinity0
Copy link

{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}

import           Language.Haskell.TH

symFQN :: Name -> Q Type
symFQN n = do
  loc <- location
  pure $ LitT $ StrTyLit $ loc_module loc ++ "." ++ nameBase n

staticKey :: Name -> Q Exp
staticKey name = [| sing @ $(symFQN name) |]

main = pure ()
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.1
$ ghc Test.hs
Loaded package environment from $PWD/.ghc.environment.x86_64-linux-8.10.1
[1 of 1] Compiling Main             ( Test.hs, Test.o, Test.dyn_o )
Linking Test ...
$ ormolu --version
ormolu 0.1.0.0 UNKNOWN UNKNOWN
using ghc-lib-parser 8.10.1.20200523
$ ormolu -d -minplace Test.hs
warnings:


parse result:
  comment stream:


AST of input and AST of formatted code differ.
  at Test.hs:12:21-41
Please, consider reporting the bug.

5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants