Fix comment wandering left inside instance decls

remotes/felixonmars/release
Lennart Spitzner 2019-08-28 14:48:11 +02:00
parent 698356a880
commit f289389879
2 changed files with 8 additions and 0 deletions

View File

@ -1065,6 +1065,13 @@ type ((a :+: b) c) = (a, c)
instance MyClass Int where
myMethod x = x + 1
#test simple-method-comment
instance MyClass Int where
myMethod x =
-- insightful comment
x + 1
#test simple-method-signature
instance MyClass Int where

View File

@ -858,6 +858,7 @@ layoutClsInst :: ToBriDoc ClsInstDecl
layoutClsInst lcid@(L _ cid) = docLines
[ layoutInstanceHead
, docEnsureIndent BrIndentRegular
$ docSetIndentLevel
$ docSortedLines
$ fmap layoutAndLocateSig (cid_sigs cid)
++ fmap layoutAndLocateBind (bagToList $ cid_binds cid)