GraphQLSwift / GraphQL

The Swift GraphQL implementation for macOS and Linux
MIT License
938 stars 72 forks source link

Changing Void() default parameters to avoid a recent compiler crasher #88

Closed BradLarson closed 3 years ago

BradLarson commented 3 years ago

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.

paulofaria commented 3 years ago

I'm OK with this change.

BradLarson commented 3 years ago

This is getting fixed at the source in the compiler: https://github.com/apple/swift/pull/39522 , so if that can be confirmed to address the issue I'll close this out.

paulofaria commented 3 years ago

@NeedleInAJayStack Do you reckon this can be merged and added to the next release?

NeedleInAJayStack commented 3 years ago

@paulofaria Sure!