Skip to content

Commit 4121708

Browse files
authored
Merge pull request swiftlang#637 from natecook1000/variadics_some_swiftmain
[swift/main] Use `some RegexComponent` in variadic inits
2 parents 80bbb21 + 58c6b4e commit 4121708

File tree

9 files changed

+1630
-1438
lines changed

9 files changed

+1630
-1438
lines changed

Sources/RegexBuilder/DSL.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
@available(SwiftStdlib 5.7, *)
1616
extension Regex {
1717
/// Creates a regular expression using a RegexBuilder closure.
18-
public init<Content: RegexComponent>(
19-
@RegexComponentBuilder _ content: () -> Content
20-
) where Content.RegexOutput == Output {
18+
public init(
19+
@RegexComponentBuilder _ content: () -> some RegexComponent<Output>
20+
) {
2121
self = content().regex
2222
}
2323
}
@@ -91,9 +91,9 @@ public struct One<Output>: RegexComponent {
9191
public var regex: Regex<Output>
9292

9393
/// Creates a regex component that matches the given component exactly once.
94-
public init<Component: RegexComponent>(
95-
_ component: Component
96-
) where Component.RegexOutput == Output {
94+
public init(
95+
_ component: some RegexComponent<Output>
96+
) {
9797
self.regex = component.regex
9898
}
9999
}

Sources/RegexBuilder/Variadics.swift

Lines changed: 1466 additions & 1263 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)