Skip to content

Commit 37e0551

Browse files
isovectorAilrunberberman
authored
Fix record layout (#1851)
* Fix record layout * Don't change the record update rules Co-authored-by: Junyoung/Clare Jang <[email protected]> Co-authored-by: Potato Hatsue <[email protected]>
1 parent a06b2e6 commit 37e0551

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

ghcide/src/Development/IDE/GHC/ExactPrint.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ needsParensSpace HsMultiIf{} = (All False, All False)
203203
needsParensSpace HsLet{} = (All False, All True)
204204
needsParensSpace HsDo{} = (All False, All False)
205205
needsParensSpace ExplicitList{} = (All False, All False)
206-
needsParensSpace RecordCon{} = (All False, All False)
206+
needsParensSpace RecordCon{} = (All False, All True)
207207
needsParensSpace RecordUpd{} = mempty
208208
needsParensSpace _ = mempty
209209

plugins/hls-tactics-plugin/test/CodeAction/IntrosSpec.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ spec = do
1414
describe "golden" $ do
1515
introsTest 2 8 "GoldenIntros"
1616

17+
describe "layout" $ do
18+
introsTest 4 24 "LayoutRec"
19+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data Pair a b = Pair {pa :: a, pb :: b}
2+
3+
p :: Pair (a -> a) (a -> b -> c -> b)
4+
p = Pair {pa = _, pb = \ a b c -> _}
5+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
data Pair a b = Pair {pa :: a, pb :: b}
2+
3+
p :: Pair (a -> a) (a -> b -> c -> b)
4+
p = Pair {pa = _, pb = _}
5+

0 commit comments

Comments
 (0)