mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Synthesizing the body of a throwing main didn't take into account the implicit try. We were creating one, then just leaving it off. This patch actually passes the modified AST branch through to the emitted return statement, rather than just keeping the call. As a separate note, I hit an assert saying that a source range must either be completely invalid or completely valid when just passing the invalid SourceLoc to the TryExpr. I've changed it to just take the SourceLoc from the implicit CallExpr, which should be the same as the invalid SourceLoc, but seems to inherit it from another place.