File tree Expand file tree Collapse file tree 4 files changed +38
-1
lines changed
plugins/hls-tactics-plugin Expand file tree Collapse file tree 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)
220220 . foldMap (\ n -> bool (pure n) mempty $ check n)
221221 $ tn <> fmap (<> " '" ) tn
222222 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+
224246
225247
226248------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ spec = do
2020 destructTest " b" 7 10 " DestructTyFam"
2121 destructTest " b" 7 10 " DestructDataFam"
2222 destructTest " b" 17 10 " DestructTyToDataFam"
23+ destructTest " t" 6 10 " DestructInt"
2324
2425 describe " layout" $ do
2526 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