@@ -23,6 +23,7 @@ import GHC.SourceGen.Binds
2323import GHC.SourceGen.Expr
2424import GHC.SourceGen.Overloaded
2525import GHC.SourceGen.Pat
26+ import Ide.Plugin.Tactic.GHC
2627import Ide.Plugin.Tactic.Judgements
2728import Ide.Plugin.Tactic.Machinery
2829import Ide.Plugin.Tactic.Naming
@@ -120,13 +121,13 @@ unzipTrace l =
120121
121122
122123-- | Essentially same as 'dataConInstOrigArgTys' in GHC,
123- -- but we need some tweaks in GHC >= 8.8.
124- -- Since old 'dataConInstArgTys' seems working with >= 8.8,
125- -- we just filter out class dictionaries and coercions from the result.
124+ -- but only accepts universally quantified types as the second arguments
125+ -- and automatically introduces existentials.
126126dataConInstOrigArgTys' :: DataCon -> [Type ] -> [Type ]
127- dataConInstOrigArgTys' con ty =
128- let tys0 = dataConInstOrigArgTys con ty
129- in filter (not . isPredTy) tys0
127+ dataConInstOrigArgTys' con uniTys =
128+ let exvars = dataConExTys con
129+ in dataConInstOrigArgTys con $
130+ uniTys ++ map mkTyVarTy exvars
130131
131132------------------------------------------------------------------------------
132133-- | Combinator for performing case splitting, and running sub-rules on the
0 commit comments