@@ -138,33 +138,34 @@ normalizeLies = sortOn (getIewn . unLoc) . M.elems . foldl' combine M.empty
138
138
alter = \ case
139
139
Nothing -> Just . L new_l $
140
140
case new of
141
- IEThingWith _ n wildcard g ->
142
- IEThingWith ( Nothing , EpAnnNotUsed ) n wildcard (normalizeWNames g)
141
+ IEThingWith x n wildcard g _ ->
142
+ IEThingWith x n wildcard (normalizeWNames g) Nothing
143
143
other -> other
144
144
Just old ->
145
145
let f = \ case
146
- IEVar _ n -> IEVar Nothing n
147
- IEThingAbs _ _ -> new
148
- IEThingAll _ n -> IEThingAll ( Nothing , EpAnnNotUsed ) n
149
- IEThingWith _ n wildcard g ->
146
+ IEVar _ n _ -> IEVar Nothing n Nothing
147
+ IEThingAbs _ _ _ -> new
148
+ IEThingAll x n _ -> IEThingAll x n Nothing
149
+ IEThingWith _ n wildcard g _ ->
150
150
case new of
151
- IEVar _ _ ->
151
+ IEVar _ _ _ ->
152
152
error " Ormolu.Imports broken presupposition"
153
- IEThingAbs _ _ ->
154
- IEThingWith ( Nothing , EpAnnNotUsed ) n wildcard g
155
- IEThingAll _ n' ->
156
- IEThingAll ( Nothing , EpAnnNotUsed ) n'
157
- IEThingWith _ n' wildcard' g' ->
153
+ IEThingAbs x _ _ ->
154
+ IEThingWith x n wildcard g Nothing
155
+ IEThingAll x n' _ ->
156
+ IEThingAll x n' Nothing
157
+ IEThingWith x n' wildcard' g' _ ->
158
158
let combinedWildcard =
159
159
case (wildcard, wildcard') of
160
160
(IEWildcard _, _) -> IEWildcard 0
161
161
(_, IEWildcard _) -> IEWildcard 0
162
162
_ -> NoIEWildcard
163
163
in IEThingWith
164
- ( Nothing , EpAnnNotUsed )
164
+ x
165
165
n'
166
166
combinedWildcard
167
167
(normalizeWNames (g <> g'))
168
+ Nothing
168
169
IEModuleContents _ _ -> notImplemented " IEModuleContents"
169
170
IEGroup NoExtField _ _ -> notImplemented " IEGroup"
170
171
IEDoc NoExtField _ -> notImplemented " IEDoc"
@@ -187,10 +188,10 @@ instance Ord IEWrappedNameOrd where
187
188
-- | Project @'IEWrappedName' 'GhcPs'@ from @'IE' 'GhcPs'@.
188
189
getIewn :: IE GhcPs -> IEWrappedNameOrd
189
190
getIewn = \ case
190
- IEVar _ x -> IEWrappedNameOrd (unLoc x)
191
- IEThingAbs _ x -> IEWrappedNameOrd (unLoc x)
192
- IEThingAll _ x -> IEWrappedNameOrd (unLoc x)
193
- IEThingWith _ x _ _ -> IEWrappedNameOrd (unLoc x)
191
+ IEVar _ x _ -> IEWrappedNameOrd (unLoc x)
192
+ IEThingAbs _ x _ -> IEWrappedNameOrd (unLoc x)
193
+ IEThingAll _ x _ -> IEWrappedNameOrd (unLoc x)
194
+ IEThingWith _ x _ _ _ -> IEWrappedNameOrd (unLoc x)
194
195
IEModuleContents _ _ -> notImplemented " IEModuleContents"
195
196
IEGroup NoExtField _ _ -> notImplemented " IEGroup"
196
197
IEDoc NoExtField _ -> notImplemented " IEDoc"
0 commit comments