diff --git a/Sources/_StringProcessing/Utility/TypeVerification.swift b/Sources/_StringProcessing/Utility/TypeVerification.swift index df0b59f2c..0ad8aa325 100644 --- a/Sources/_StringProcessing/Utility/TypeVerification.swift +++ b/Sources/_StringProcessing/Utility/TypeVerification.swift @@ -14,6 +14,10 @@ @available(SwiftStdlib 5.7, *) extension Regex { internal func _verifyType() -> Bool { + guard Output.self != AnyRegexOutput.self else { + return true + } + var tupleElements: [Any.Type] = [Substring.self] var labels = " " diff --git a/Tests/RegexBuilderTests/AnyRegexOutputTests.swift b/Tests/RegexBuilderTests/AnyRegexOutputTests.swift index 9b32a86fd..d628ce0d9 100644 --- a/Tests/RegexBuilderTests/AnyRegexOutputTests.swift +++ b/Tests/RegexBuilderTests/AnyRegexOutputTests.swift @@ -138,8 +138,7 @@ extension RegexDSLTests { ) { let aro = Regex(re) - // FIXME: The below fatal errors - let casted = aro//try! XCTUnwrap(Regex(aro, as: Output.self)) + let casted = try! XCTUnwrap(Regex(aro, as: Output.self)) // contains(captureNamed:) checkContains(re, kind) @@ -173,7 +172,7 @@ extension RegexDSLTests { (?x) (\p{hexdigit}{4}) -? (?\p{hexdigit}{4}) -? (\p{hexdigit}{4}) -? (\p{hexdigit}{4}) - """#, as: (Substring, Substring, Substring, Substring, Substring).self), + """#, as: (Substring, Substring, salient: Substring, Substring, Substring).self), .salient, salientOutput ) @@ -181,7 +180,7 @@ extension RegexDSLTests { (?x) (\p{hexdigit}{4}) -? (?\p{hexdigit}{4}) -? (\p{hexdigit}{4}) -? (\p{hexdigit}{4}) - """#, as: (Substring, Substring, Substring, Substring, Substring).self), + """#, as: (Substring, Substring, note: Substring, Substring, Substring).self), .note, noteOutput )