ndmitchell / hlint

Haskell source code suggestions
Other
1.48k stars 195 forks source link

False positive: TemplateHaskell is not redundant when using Typed template haskell splices #1557

Closed NorfairKing closed 10 months ago

NorfairKing commented 10 months ago

In this module, the TemplateHaskell pragma is considered redundant but it isn't:

{-# LANGUAGE TemplateHaskell #-}
module Example where

val = $$(spliceHere)
ndmitchell commented 10 months ago

Using HLint 3.8 I get:

Sample.hs:4:9-20: Warning: Redundant bracket
Found:
  (spliceHere)
Perhaps:
  spliceHere

1 hint

Which I think is actually correct. Which version are you using?

NorfairKing commented 10 months ago

Oh, looks like I'm using (recently upgraded to) 3.6.1:

/nix/store/0f8wii5x1vnjmgy1asyh2175092xy8rm-hlint-3.6.1/bin/hlint smos-docs-site/src/Smos/Docs/Site/Changelog.hs       
smos-docs-site/src/Smos/Docs/Site/Changelog.hs:3:1-32: Warning: Unused LANGUAGE pragma
Found:
  {-# LANGUAGE TemplateHaskell #-}
Perhaps you should remove it.
Note: may require `{-# LANGUAGE TemplateHaskellQuotes #-}` adding to the top of the file

I'll see if I can try out a newer hlint. Feel free to close this if it's indeed fixed already.