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 ()
191
191
split = tracing " split(user)" $ do
192
192
jdg <- goal
193
193
let g = jGoal jdg
194
- case splitTyConApp_maybe $ unCType g of
194
+ case tacticsGetDataCons $ unCType g of
195
195
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
199
197
200
198
201
199
------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -143,9 +143,12 @@ spec = do
143
143
refineTest " RefineReader.hs" 4 8
144
144
refineTest " RefineGADT.hs" 8 8
145
145
146
+ -- test via:
147
+ -- stack test hls-tactics-plugin --test-arguments '--match "Golden/golden tests/"'
146
148
describe " golden tests" $ do
147
149
let autoTest = mkGoldenTest allFeatures Auto " "
148
150
151
+ autoTest " AutoSplitGADT.hs" 11 8
149
152
goldenTest Intros " " " GoldenIntros.hs" 2 8
150
153
autoTest " GoldenEitherAuto.hs" 2 11
151
154
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