diff --git a/plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/Tactics.hs b/plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/Tactics.hs index ab1932036a..7af41cbacd 100644 --- a/plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/Tactics.hs +++ b/plugins/hls-tactics-plugin/src/Ide/Plugin/Tactic/Tactics.hs @@ -167,10 +167,7 @@ apply hi = requireConcreteHole $ tracing ("apply' " <> show (hi_name hi)) $ do func = hi_name hi ty' <- freshTyvars ty let (_, _, args, ret) = tacticsSplitFunTy ty' - -- TODO(sandy): Bug here! Prevents us from doing mono-map like things - -- Don't require new holes for locally bound vars; only respect linearity - -- see https://github.com/haskell/haskell-language-server/issues/1447 - requireNewHoles $ rule $ \jdg -> do + rule $ \jdg -> do unify g (CType ret) ext <- fmap unzipTrace diff --git a/plugins/hls-tactics-plugin/test/CodeAction/AutoSpec.hs b/plugins/hls-tactics-plugin/test/CodeAction/AutoSpec.hs index 7e01a0a2eb..c3f144cf45 100644 --- a/plugins/hls-tactics-plugin/test/CodeAction/AutoSpec.hs +++ b/plugins/hls-tactics-plugin/test/CodeAction/AutoSpec.hs @@ -45,6 +45,7 @@ spec = do autoTest 2 14 "FmapJoin.hs" autoTest 2 9 "Fgmap.hs" autoTest 4 19 "FmapJoinInLet.hs" + autoTest 9 12 "AutoEndo.hs" failing "flaky in CI" $ autoTest 2 11 "GoldenApplicativeThen.hs" diff --git a/plugins/hls-tactics-plugin/test/golden/AutoEndo.hs b/plugins/hls-tactics-plugin/test/golden/AutoEndo.hs new file mode 100644 index 0000000000..c92e6adb5b --- /dev/null +++ b/plugins/hls-tactics-plugin/test/golden/AutoEndo.hs @@ -0,0 +1,10 @@ +data Synthesized b a = Synthesized + { syn_trace :: b + , syn_val :: a + } + deriving (Eq, Show) + + +mapTrace :: (b -> b) -> Synthesized b a -> Synthesized b a +mapTrace = _ + diff --git a/plugins/hls-tactics-plugin/test/golden/AutoEndo.hs.expected b/plugins/hls-tactics-plugin/test/golden/AutoEndo.hs.expected new file mode 100644 index 0000000000..4b50c6c074 --- /dev/null +++ b/plugins/hls-tactics-plugin/test/golden/AutoEndo.hs.expected @@ -0,0 +1,11 @@ +data Synthesized b a = Synthesized + { syn_trace :: b + , syn_val :: a + } + deriving (Eq, Show) + + +mapTrace :: (b -> b) -> Synthesized b a -> Synthesized b a +mapTrace fbb (Synthesized b a) + = Synthesized {syn_trace = fbb b, syn_val = a} +