Changing Void() default parameters to avoid a recent compiler crasher #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Starting with the August 28, 2021 Swift.org nightly development snapshot, there is currently a compiler crasher when building Swift code that contains a default parameter of
Void()
with debug symbols enabled. This has been reported as SR-15181 and the Swift team is aware of it.An easy way to work around this is to make the stylistic change from
= Void()
to= ()
in these default parameters. That no longer triggers the compiler crasher. I've done that here, because GraphQL was the only project in our dependencies that had an example of this specific crasher.This crasher did not make its way into the 5.5 release, and most likely will be fixed before the next stable release, so I understand if you're hesitant to make this stylistic change based on what's probably a temporary crasher. We use compiler toolchains based on Swift head in order to employ the latest experimental differentiable Swift capabilities, and rely on GraphQL within our project, so we're a bit of a special case. This crasher is preventing us from stepping up our Swift toolchains to use Swift head, however.
Again, I understand if you don't want to make this change while this crasher is being looked into. The true fix is to address it at the source in the compiler, but I'm unsure how long that will take.