File tree Expand file tree Collapse file tree 4 files changed +29
-4
lines changed
plugins/hls-tactics-plugin Expand file tree Collapse file tree 4 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -191,11 +191,9 @@ split :: TacticsM ()
191191split = tracing " split(user)" $ do
192192 jdg <- goal
193193 let g = jGoal jdg
194- case splitTyConApp_maybe $ unCType g of
194+ case tacticsGetDataCons $ unCType g of
195195 Nothing -> throwError $ GoalMismatch " split" g
196- Just (tc, _) -> do
197- let dcs = tyConDataCons tc
198- choice $ fmap splitDataCon dcs
196+ Just (dcs, _) -> choice $ fmap splitDataCon dcs
199197
200198
201199------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -143,9 +143,12 @@ spec = do
143143 refineTest " RefineReader.hs" 4 8
144144 refineTest " RefineGADT.hs" 8 8
145145
146+ -- test via:
147+ -- stack test hls-tactics-plugin --test-arguments '--match "Golden/golden tests/"'
146148 describe " golden tests" $ do
147149 let autoTest = mkGoldenTest allFeatures Auto " "
148150
151+ autoTest " AutoSplitGADT.hs" 11 8
149152 goldenTest Intros " " " GoldenIntros.hs" 2 8
150153 autoTest " GoldenEitherAuto.hs" 2 11
151154 autoTest " GoldenJoinCont.hs" 4 12
Original file line number Diff line number Diff line change 1+ {-# LANGUAGE GADTs #-}
2+
3+ data GADT b a where
4+ GBool :: b -> GADT b Bool
5+ GInt :: GADT b Int
6+
7+ -- wingman would prefer to use GBool since then it can use its argument. But
8+ -- that won't unify with GADT Int, so it is forced to pick GInt and ignore the
9+ -- argument.
10+ test :: b -> GADT b Int
11+ test = _
12+
Original file line number Diff line number Diff line change 1+ {-# LANGUAGE GADTs #-}
2+
3+ data GADT b a where
4+ GBool :: b -> GADT b Bool
5+ GInt :: GADT b Int
6+
7+ -- wingman would prefer to use GBool since then it can use its argument. But
8+ -- that won't unify with GADT Int, so it is forced to pick GInt and ignore the
9+ -- argument.
10+ test :: b -> GADT b Int
11+ test _ = GInt
12+
You can’t perform that action at this time.
0 commit comments