File tree 4 files changed +38
-1
lines changed
plugins/hls-tactics-plugin
4 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,29 @@ mkGoodName in_scope (mkTyName -> tn)
220
220
. foldMap (\ n -> bool (pure n) mempty $ check n)
221
221
$ tn <> fmap (<> " '" ) tn
222
222
where
223
- check n = S. member (mkVarOcc n) in_scope
223
+ check n = S. member (mkVarOcc n) $ illegalNames <> in_scope
224
+
225
+
226
+ illegalNames :: Set OccName
227
+ illegalNames = S. fromList $ fmap mkVarOcc
228
+ [ " case"
229
+ , " of"
230
+ , " class"
231
+ , " data"
232
+ , " do"
233
+ , " type"
234
+ , " if"
235
+ , " then"
236
+ , " else"
237
+ , " let"
238
+ , " in"
239
+ , " mdo"
240
+ , " newtype"
241
+ , " proc"
242
+ , " rec"
243
+ , " where"
244
+ ]
245
+
224
246
225
247
226
248
------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ spec = do
20
20
destructTest " b" 7 10 " DestructTyFam"
21
21
destructTest " b" 7 10 " DestructDataFam"
22
22
destructTest " b" 17 10 " DestructTyToDataFam"
23
+ destructTest " t" 6 10 " DestructInt"
23
24
24
25
describe " layout" $ do
25
26
destructTest " b" 4 3 " LayoutBind"
Original file line number Diff line number Diff line change
1
+ import Data.Int
2
+
3
+ data Test = Test Int32
4
+
5
+ test :: Test -> Int32
6
+ test (Test in') = _w0
7
+
Original file line number Diff line number Diff line change
1
+ import Data.Int
2
+
3
+ data Test = Test Int32
4
+
5
+ test :: Test -> Int32
6
+ test t = _
7
+
You can’t perform that action at this time.
0 commit comments