Skip to content
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

Use #fileID/#filePath instead of #file #2306

Merged
merged 3 commits into from Nov 3, 2022

Conversation

carolinacass
Copy link
Contributor

Motivation:

#fileID introduced in Swift 5.3, so no longer need to use #file anywhere

Modifications:

Changed #file to #filePath or #fileID depending on the situation

Motivation:

Modifications:

Changed #file to #filePath or #fileID depending on the situation
Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of small things need fixing but the rest looks good.

@@ -0,0 +1,218 @@
//===----------------------------------------------------------------------===//
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file shouldn't exist anymore, it was removed in #2292

@@ -786,7 +786,7 @@ extension EventLoop {
line: UInt,
_ task: @escaping FlatScheduleTaskDelayCallback<T>
) -> Scheduled<T> {
let promise: EventLoopPromise<T> = self.makePromise(file:#file, line: line)
let promise: EventLoopPromise<T> = self.makePromise(file:#fileID, line: line)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there was a bug here, it should just be the file passed into the func

Suggested change
let promise: EventLoopPromise<T> = self.makePromise(file:#fileID, line: line)
let promise: EventLoopPromise<T> = self.makePromise(file: file, line: line)

Comment on lines 510 to 515
<<<<<<< Updated upstream
fileprivate func XCTAsyncAssertTrue(_ predicate: @autoclosure () async throws -> Bool, file: StaticString = #file, line: UInt = #line) async rethrows {
=======
#if compiler(>=5.5.2) && canImport(_Concurrency)
fileprivate func XCTAsyncAssertTrue(_ predicate: @autoclosure () async throws -> Bool, file: StaticString = #filePath, line: UInt = #line) async rethrows {
>>>>>>> Stashed changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, bad merge, I think you want:

Suggested change
<<<<<<< Updated upstream
fileprivate func XCTAsyncAssertTrue(_ predicate: @autoclosure () async throws -> Bool, file: StaticString = #file, line: UInt = #line) async rethrows {
=======
#if compiler(>=5.5.2) && canImport(_Concurrency)
fileprivate func XCTAsyncAssertTrue(_ predicate: @autoclosure () async throws -> Bool, file: StaticString = #filePath, line: UInt = #line) async rethrows {
>>>>>>> Stashed changes
fileprivate func XCTAsyncAssertTrue(_ predicate: @autoclosure () async throws -> Bool, file: StaticString = #filePath, line: UInt = #line) async rethrows {

Comment on lines 30 to 35
<<<<<<< Updated upstream
("testHTTPResponseStatusFromStatusCode", testHTTPResponseStatusFromStatusCode),
("testHTTPResponseStatusCodeAndReason", testHTTPResponseStatusCodeAndReason),
=======
("testHTTPResponseStatusFromStatusCode", testHTTPResponseStatusFromStatusCode),
>>>>>>> Stashed changes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad merge again. The best way to fix this one is to run ./scripts/generate_linux_tests.rb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would I know when I need to run this in the future?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every time you add tests. Also one of the CI jobs ("pull request validation (soundness)") will fail if it needs to be run and hasn't been.

@glbrntt glbrntt added the patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label Nov 3, 2022
@glbrntt
Copy link
Contributor

glbrntt commented Nov 3, 2022

Nightly CI failure is unrelated. Merging over it.

@glbrntt glbrntt merged commit af41276 into apple:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants