-
Notifications
You must be signed in to change notification settings - Fork 441
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
Fix compile errors for Swift 6 language mode #230
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this, @b1ackturtle — just one set of changes and we can merge this.
@@ -16,7 +16,7 @@ func validateRandomSamples<S: Sequence>( | |||
_ samples: [Int: Int], | |||
elements: S, | |||
expectedValue: Int, | |||
file: StaticString = #file, line: UInt = #line | |||
file: StaticString = #filePath, line: UInt = #line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we resolve these warnings in this way instead? The #filePath
attribute was introduced in Swift 5.8, but we're going to support back to Swift 5.7 in the next release of this package.
file: StaticString = #filePath, line: UInt = #line | |
file: StaticString = (#file), line: UInt = #line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review. I have updated my code based on your suggestion.
b1cf3c3
to
135802f
Compare
@swift-ci please test |
@@ -13,7 +13,7 @@ import XCTest | |||
import Algorithms | |||
|
|||
final class GroupedTests: XCTestCase { | |||
private class SampleError: Error {} | |||
private final class SampleError: Error {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain, why do we need this final keyword here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was added to resolve the following error:
Non-final class 'SampleError' cannot conform to 'Sendable'; use @unchecked Sendable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation. Can you please also update you branch with base branch?
135802f
to
c378d3c
Compare
This PR fixes code that caused compile errors when enabling the Swift 6 language mode.
Checklist