Skip to content

Commit

Permalink
Router: handle empty return type (procedure decl)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Apr 18, 2022
1 parent eef7156 commit 0263c75
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,8 @@ class Router(formatOps: FormatOps) {
case Some(ft @ FormatToken(_, _: T.Comma, _)) if oneline => ft
case Some(FormatToken(_, _: T.RightParen, _))
if style.newlines.avoidInResultType =>
defDefReturnType(leftOwner).fold(lastFT)(getLastNonTrivial)
val rt = defDefReturnType(leftOwner) // could be empty tree
rt.flatMap(tokens.getLastNonTrivialOpt).getOrElse(lastFT)
case _ => lastFT
}
val nlPolicy = (if (oneline) nextCommaOrParen else None) match {
Expand Down

0 comments on commit 0263c75

Please sign in to comment.