Skip to content

Conversation

@bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Apr 3, 2023

  • Explanation: Rather than having the possibility of nil trivia and requiring all clients to check every use, just return empty trivia when there are no nodes present.
  • Scope: All swift-syntax clients using leading/trailingTrivia
  • Risk: Extremely low, uses generally created an empty Trivia anyway
  • Testing: No additional tests
  • Original PR: Make leading/trailing trivia required fields #1477

Rather than having the possibility of `nil` trivia and requiring all
clients to check every use, just return empty trivia when there are no
nodes present.

(cherry picked from commit 4d2212c)
@bnbarham
Copy link
Contributor Author

bnbarham commented Apr 3, 2023

@bnbarham bnbarham merged commit 9bd3d12 into swiftlang:release/5.9 Apr 4, 2023
@bnbarham bnbarham deleted the cherry-trivia-fixes branch April 4, 2023 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants