mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When a function declaration has no body (e.g. because it’s a protocol requirement), we construct the range to replace by the `async` keyword as follows: - Start: One character after the closing `)` (or potentially the `throws` keyword if it exists) - End: Last token in the function declaration Since the last token in the function declaration is the `)`, we end up with a range that has `End < Start`, which crashes when trying to print the range. If the function has no body, we should just use the range’s start location as the end location to construct an empty range. Fixes rdar://76677035
191 KiB
191 KiB