Skip to content

Add @retroactive to conformances that need it #712

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

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/RegexBuilder/DSL.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ internal protocol _BuiltinRegexComponent: RegexComponent {
// MARK: - Primitive regex components

@available(SwiftStdlib 5.7, *)
extension String: RegexComponent {
extension String: @retroactive RegexComponent {
public typealias Output = Substring

public var regex: Regex<Output> { .init(verbatim: self) }
}

@available(SwiftStdlib 5.7, *)
extension Substring: RegexComponent {
extension Substring: @retroactive RegexComponent {
public typealias Output = Substring

public var regex: Regex<Output> { String(self).regex }
}

@available(SwiftStdlib 5.7, *)
extension Character: RegexComponent {
extension Character: @retroactive RegexComponent {
public typealias Output = Substring

public var regex: Regex<Output> {
Expand All @@ -55,7 +55,7 @@ extension Character: RegexComponent {
}

@available(SwiftStdlib 5.7, *)
extension UnicodeScalar: RegexComponent {
extension UnicodeScalar: @retroactive RegexComponent {
public typealias Output = Substring

public var regex: Regex<Output> {
Expand Down