-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
allow #file to #filePath forwarding without warnings #32445
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci smoke test |
weissi
added a commit
to weissi/swift-nio
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to weissi/swift-nio
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to weissi/swift-log
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to weissi/swift-nio-http2
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to weissi/swift-nio-transport-services
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to weissi/swift-nio
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
Lukasa
pushed a commit
to apple/swift-nio-http2
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
Lukasa
pushed a commit
to apple/swift-nio-transport-services
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to apple/swift-nio
that referenced
this pull request
Jun 18, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
weissi
added a commit
to apple/swift-log
that referenced
this pull request
Jun 22, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
glbrntt
added a commit
to glbrntt/swift-nio-ssl
that referenced
this pull request
Jun 30, 2020
Motivation: Swift 5.3 warns when `#file` is passed to a function expecting `#filePath` even though the values are currently the same. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: - Wrap `file` in parentheses to silence warnings. Result: - No warnings, uglier code
Lukasa
pushed a commit
to apple/swift-nio-ssl
that referenced
this pull request
Jun 30, 2020
Motivation: Swift 5.3 warns when `#file` is passed to a function expecting `#filePath` even though the values are currently the same. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: - Wrap `file` in parentheses to silence warnings. Result: - No warnings, uglier code
golang4gg
pushed a commit
to golang4gg/swift-log
that referenced
this pull request
Jul 4, 2020
Motivation: only works if done when _calling_ a function, not when defining one :|. - swiftlang/swift#32445 - https://bugs.swift.org/browse/SR-12936 - https://bugs.swift.org/browse/SR-12934 - https://bugs.swift.org/browse/SR-13041 Modifications: Silence #file to #filePath differently. Result: Hopefully at some point we get this working.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
As of
master
/5.3 branch,#file
==#filePath
. However, libraries will switch to defaultingfile
parameters to#filePath
and some already have. Unfortunately, before this patch forwarding#file
to a parameter defaulted to#filePath
will issue a warning.The warning suggests a way to silence the warning (using an extra set of parenthesis
file: (#file)
) but unfortunately, this forwarding does not actually work. You will get the#file
from where the ((#file)
) has been written and not the callee's#file
.For all packages that do SemVer (ie. lots of them) we need to retain compatibility with Swift versions prior to 5.3 so we cannot just adopt
#filePath
. I documented the various serious problems and concerns with the current implementation in the following three issues.This patch switches this particular warning (
#file
to#filePath
) off. And if none of the other issues above are fixed independently, this needs to go into Swift 5.3.