Skip to content

Commit d8d7f4c

Browse files
committed
Use dataConInstOrigArgTys instaed of dataConInstArgTys
1 parent 93a3b53 commit d8d7f4c

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

plugins/tactics/src/Ide/Plugin/Tactic/CodeGen.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ destructMatches f f2 t jdg = do
3838
case dcs of
3939
[] -> throwError $ GoalMismatch "destruct" g
4040
_ -> for dcs $ \dc -> do
41-
let args = dataConInstArgTys dc apps
41+
let args = dataConInstOrigArgTys dc apps
4242
names <- mkManyGoodNames hy args
4343

4444
let pat :: Pat GhcPs

test/functional/Tactic.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ tests = testGroup
9393
, goldenTest "GoldenEitherHomomorphic.hs" 2 15 Auto ""
9494
, goldenTest "GoldenNote.hs" 2 8 Auto ""
9595
, goldenTest "GoldenPureList.hs" 2 12 Auto ""
96+
, goldenTest "GoldenGADTDestruct.hs" 7 17 Destruct "gadt"
9697
]
9798

9899

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{-# LANGUAGE GADTs #-}
2+
module GoldenGADTDestruct where
3+
data CtxGADT where
4+
MkCtxGADT :: (Show a, Eq a) => a -> CtxGADT
5+
6+
ctxGADT :: CtxGADT -> String
7+
ctxGADT gadt = _decons
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{-# LANGUAGE GADTs #-}
2+
module GoldenGADTDestruct where
3+
data CtxGADT where
4+
MkCtxGADT :: (Show a, Eq a) => a -> CtxGADT
5+
6+
ctxGADT :: CtxGADT -> String
7+
ctxGADT gadt = (case gadt of { (MkCtxGADT a) -> _ })

0 commit comments

Comments
 (0)