-
Notifications
You must be signed in to change notification settings - Fork 182
Implement source location information for pairwise block builders #58
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
Conversation
Package.swift
Outdated
dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation"]), | ||
dependencies: ["AsyncAlgorithms", "AsyncSequenceValidation"], | ||
swiftSettings: [ | ||
.unsafeFlags(["-Xfrontend", "-enable-experimental-pairwise-build-block"]) |
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.
This is needed for now until that feature lands. Right now if you want to try out the branch you have to use the latest toolchain download from swift.org.
AccumulatedInputsWithOperation(inputs: [], operation: operation) | ||
} | ||
|
||
public static func buildBlock(combining input: String, into accumulated: AccumulatedInputs, file: StaticString = #file, line: UInt = #line) -> AccumulatedInputs { |
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.
This syntax will eventually be altered slightly but the same concept will be available.
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.
Neat! Can you show what the output looks like with the failure now?
I could reconstitute the output if we wanted as additional diagnostics. |
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.
🎉
FYI this PR implements the new name |
02a0ab4
to
cc05f49
Compare
.unsafeFlags([ | ||
"-Xfrontend", "-disable-availability-checking" | ||
"-Xfrontend", "-disable-availability-checking", | ||
"-Xfrontend", "-enable-experimental-pairwise-build-block" |
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.
This is now available as of the 3/9 toolchain
This is a proof of concept for https://forums.swift.org/t/pitch-buildpartialblock-for-result-builders/55561 usage. It allows us to ferry full information of where the failure occurs as a source location; and potentially even string index in that output.
The errors are MUCH easier to identify using this approach because now they can emit directly where the expectation failure occurs.