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

False Positive, suggesting unused TemplateHaskell language pragma #1541

Closed
rickowens opened this issue Sep 20, 2023 · 2 comments
Closed

False Positive, suggesting unused TemplateHaskell language pragma #1541

rickowens opened this issue Sep 20, 2023 · 2 comments

Comments

@rickowens
Copy link

I have a module with the following content:

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}

module MyModule (
  staticAssets,
) where


import Language.Haskell.TH (Code(Code))
import Network.Wai (Middleware)
import OM.HTTP (staticSite)


staticAssets :: Middleware
staticAssets = $$(Code (staticSite "static"))

where OM.HTTP is from the om-http package (I don't believe this is relevant, but I can simplify the example further if you believe it is relevant), and the cabal file for this project specifies Haskell2010.

hlint 3.6.1 believes that the TemplateHaskell pragma is unused and suggests that I should remove it, which is clearly wrong.

src/MyModule.hs:2:1-32: Warning: Unused LANGUAGE pragma
Found:
  {-# LANGUAGE TemplateHaskell #-}
Perhaps you should remove it.

1 hint

I suspect it may not recognize the typed splice as being TemplateHaskell?

@shayne-fletcher
Copy link
Collaborator

is it an instance that #1535 would fix?

@rickowens
Copy link
Author

Yes! #1553 does fix this. Apologies, I searched for open issue of this type, but I neglected to search for closed issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants