New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-7578] offer a way to use @inlineable/@_inlineable and @usableFromInline/@_versioned in Swift 4.0, 4.1 and 4.2 #50120
Comments
I don't really know what to say here. What you were doing isn't a supported use case. @slavapestov? |
@belkadan I understand that but without that it'd be so slow that it's unusable... |
ping @slavapestov, this will unfortunately get very important for us as soon as Swift 4.2 will be released. The only (really bad) option I see to remain warning-free is to change our |
ok, what we could do is release SwiftNIO 2.0 with Swift 4.2 an just drop Swift 4.0 support, if we can get the |
Apart from only taking maintenance fixes at this point (if even that), Swift 4.1 had a bunch of bugs around inlining that we fixed in Swift 4.2. So no, we're not going to add the new spelling to the Swift 4.1 series. |
Yeah, your best bet is dropping Swift 4.0/4.1 support as soon as 4.2 is out, or living with warnings. |
@slavapestov actually, we do explicitly ask for the Swift language version swift-version 4:
seems to be the same as swift-version 4.1 (which is illegal)
but
so really, this warning should not be enabled for swift-version |
Why is it important to compile without warnings on older releases of Swift? |
@slavapestov the problem is that we'll compile with warnings on newer releases of Swift. If it were only for older releases that might be acceptable because at least the warning is actionable (ie. upgrade to get rid of it). But generally the problems with warnings is that many people want to compile with 'warnings to errors' (especially in CI) which many consider to be good style. But even without it's really bad if you get 100 warnings each time you build. You're bound to miss one warning that is actually important. We seem to have two bad options:
My argument is that 4.2 already got its on |
Ok, you win 🙂 I'll look into muffling the warning in 4.2 mode. There is another issue where 4.1 did not enforce @usableFromInline on type aliases correctly; I might have to bypass that enforcement in -swift-version 4 as well. |
I think it's okay to add correct enforcements to the model as long as you can deal with them in 4.1. |
@slavapestov Thank you very much, that makes the whole situation much much better. Ideally, we want the higher-level libraries to adopt new Swift versions the fastest and usually I think that's what's happening as higher level libraries want to use cool new language features like say Codable more often than low-level libraries. And when most clients have deprecated a certain old Swift version low-level libraries such as SwiftNIO can follow and also drop those versions asap. In the case of |
@swift-ci create |
4.2 branch? |
👍 |
thanks you @slavapestov, that's awesome!! |
@slavapestov thanks very much for that. Just tried to compile NIO again and loads of warnings are indeed gone. However there are still a lot of warnings left:
which is correct. Removing the
so the cheapest way to fix this is probably to ignore this warning too in language mode 4. |
thanks very much! |
confirmed working now on very recent 4.2 snapshots. |
Additional Detail from JIRA
md5: 84224d686477c1b60b43776fd5ff3d40
Issue Description:
For SwiftNIO we absolutely rely on
@inlineable
/@_inlineable
and@usableFromInline
/@_versioned
to get any sensible performance for our users (which can't put their code in theNIO
module). Needless to say we were very happy when the public version of this finally arrived. The problem however is that there doesn't seem to be a workable way to get it to work without warning on Swift 4.0/4.1 and 4.2.I know there technically is one possibility:
but that would mean to duplicate the whole body of every type/function/anything that is inlineable! That's totally unworkable unfortunately without starting to code generate basically the whole project...
The only way out I see would be to remove the warning as we can't change Swift 4.0 and 4.1 anymore now. Any other ideas?
The text was updated successfully, but these errors were encountered: