@@ -15,10 +15,10 @@ import Data.Data as Data
15
15
import Control.Monad.IO.Class
16
16
import Data.Maybe
17
17
import qualified TcHsSyn
18
- import qualified TysWiredIn
19
18
import qualified CoreUtils
20
19
import qualified Type
21
20
import qualified Desugar
21
+ import Haskell.Ide.Engine.Compat
22
22
23
23
import Haskell.Ide.Engine.ArtifactMap
24
24
@@ -118,20 +118,14 @@ getType hs_env e@(GHC.L spn e') =
118
118
-- Some expression forms have their type immediately available
119
119
let
120
120
tyOpt = case e' of
121
- GHC. HsLit _ l -> Just (TcHsSyn. hsLitType l)
122
- GHC. HsOverLit _ o -> Just (GHC. overLitType o)
123
-
124
- GHC. HsLam _ GHC. MG { GHC. mg_ext = groupTy } ->
125
- Just (matchGroupType groupTy)
126
- GHC. HsLamCase _ GHC. MG { GHC. mg_ext = groupTy } ->
127
- Just (matchGroupType groupTy)
128
- GHC. HsCase _ _ GHC. MG { GHC. mg_ext = groupTy } ->
129
- Just (GHC. mg_res_ty groupTy)
130
-
131
- GHC. ExplicitList ty _ _ -> Just (TysWiredIn. mkListTy ty)
132
- GHC. ExplicitSum ty _ _ _ -> Just (TysWiredIn. mkSumTy ty)
133
- GHC. HsDo ty _ _ -> Just ty
134
- GHC. HsMultiIf ty _ -> Just ty
121
+ HsOverLitType t -> Just t
122
+ HsLitType t -> Just t
123
+ HsLamType t -> Just t
124
+ HsLamCaseType t -> Just t
125
+ HsCaseType t -> Just t
126
+ ExplicitListType t -> Just t
127
+ ExplicitSumType t -> Just t
128
+ HsMultiIfType t -> Just t
135
129
136
130
_ -> Nothing
137
131
in case tyOpt of
@@ -142,8 +136,6 @@ getType hs_env e@(GHC.L spn e') =
142
136
let res = (spn, ) . CoreUtils. exprType <$> mbe
143
137
pure res
144
138
where
145
- matchGroupType :: GHC. MatchGroupTc -> GHC. Type
146
- matchGroupType (GHC. MatchGroupTc args res) = Type. mkFunTys args res
147
139
-- | Skip desugaring of these expressions for performance reasons.
148
140
--
149
141
-- See impact on Haddock output (esp. missing type annotations or links)
0 commit comments