-
Notifications
You must be signed in to change notification settings - Fork 50
Fix output type mismatch with RegexBuilder #626
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
Changes from 1 commit
ec261f1
8080d68
95b23d4
1aca1fa
5731740
c64477e
034b582
f2f0112
8c63128
38e9cef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,7 @@ struct VariadicsGenerator: ParsableCommand { | |
// | ||
// This source file is part of the Swift.org open source project | ||
// | ||
// Copyright (c) 2021-2022 Apple Inc. and the Swift project authors | ||
// Copyright (c) 2021-2023 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
|
@@ -308,7 +308,11 @@ struct VariadicsGenerator: ParsableCommand { | |
output(""" | ||
{ | ||
let factory = makeFactory() | ||
return factory.accumulate(accumulated, next) | ||
if #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) { | ||
return factory.accumulate(accumulated, factory.ignoreCapturesInTypedOutput(next)) | ||
} else { | ||
return factory.accumulate(accumulated, next) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about a helper function that will reduce spew and, more importantly, give a name and place to commend why we're doing this and how it differs across versions. E.g. // comment...
private func dropCaptures(_ next: ...) -> ... {
// ... comment about old and new behavior
if #available(...) {
return ...
}
return ...
}
...
return factory.accumulate(accumulated, dropCaptures(next)) (or some better name than There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good call, I only ever wrote this once, but it is codegen'd an awful lot. |
||
} | ||
} | ||
|
||
|
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.
Does
if #available(SwiftStdlib 5.8, *)
work?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.
No, that isn't allowed in an always-emit function.