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

Wingman: Don't wildify vars when running beginMetaprogram #1963

Merged
merged 7 commits into from
Jun 25, 2021
2 changes: 2 additions & 0 deletions plugins/hls-tactics-plugin/src/Wingman/GHC.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import TysWiredIn (charTyCon, doubleTyCon, floatTyCon, intTyCon)
import Unify
import Unique
import Var
import Wingman.StaticPlugin (pattern MetaprogramSyntax)
import Wingman.Types


Expand Down Expand Up @@ -171,6 +172,7 @@ containsHole :: Data a => a -> Bool
containsHole x = not $ null $ listify (
\case
((HsVar _ (L _ name)) :: HsExpr GhcPs) -> isHole $ occName name
MetaprogramSyntax _ -> True
_ -> False
) x

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec = do
#if __GLASGOW_HASKELL__ >= 808
describe "beginMetaprogram" $ do
goldenTest BeginMetaprogram "" 1 7 "MetaBegin"
goldenTest BeginMetaprogram "" 1 9 "MetaBeginNoWildify"
#endif

describe "golden" $ do
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foo v = [wingman||]

2 changes: 2 additions & 0 deletions plugins/hls-tactics-plugin/test/golden/MetaBeginNoWildify.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
foo v = _