Skip to content

Commit 7db9a1b

Browse files
authored
Destruct only ADTs (#1695)
1 parent 97d8965 commit 7db9a1b

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

plugins/hls-tactics-plugin/src/Wingman/Tactics.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ destructAll = do
298298
_ -> Nothing
299299
)
300300
$ fmap (\hi -> (hi, hi_provenance hi))
301+
$ filter (isAlgType . unCType . hi_type)
301302
$ unHypothesis
302303
$ jHypothesis jdg
303304
for_ args destruct

plugins/hls-tactics-plugin/test/CodeAction/DestructAllSpec.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ spec = do
3838
destructAllTest 2 11 "DestructAllAnd.hs"
3939
destructAllTest 4 23 "DestructAllMany.hs"
4040
destructAllTest 2 18 "DestructAllNonVarTopMatch.hs"
41+
destructAllTest 2 18 "DestructAllFunc.hs"
4142

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
has_a_func :: Bool -> (a -> b) -> Bool
2+
has_a_func x y = _
3+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
has_a_func :: Bool -> (a -> b) -> Bool
2+
has_a_func False y = _
3+
has_a_func True y = _
4+

0 commit comments

Comments
 (0)