From fb2a4833f89424faf874ba5e5f05d15f5fdf027c Mon Sep 17 00:00:00 2001 From: Jonathan Grynspan Date: Fri, 7 Mar 2025 17:16:58 -0500 Subject: [PATCH] Raise `types(withNamesContaining:)` to SPI rather than `package`. This PR makes `types(withNamesContaining:)` available as pre-deprecated SPI. --- Sources/_TestDiscovery/TestContentRecord.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Sources/_TestDiscovery/TestContentRecord.swift b/Sources/_TestDiscovery/TestContentRecord.swift index f576a8160..35e8392f6 100644 --- a/Sources/_TestDiscovery/TestContentRecord.swift +++ b/Sources/_TestDiscovery/TestContentRecord.swift @@ -223,10 +223,9 @@ private import _TestingInternals /// - nameSubstring: A string which the names of matching classes all contain. /// /// - Returns: A sequence of Swift types whose names contain `nameSubstring`. -/// -/// - Warning: Do not adopt this functionality in new code. It is for use by -/// Swift Testing along its legacy discovery codepath only. -package func types(withNamesContaining nameSubstring: String) -> some Sequence { +@_spi(Experimental) @_spi(ForToolsIntegrationOnly) +@available(swift, deprecated: 100000.0, message: "Do not adopt this functionality in new code. It will be removed in a future release.") +public func types(withNamesContaining nameSubstring: String) -> some Sequence { SectionBounds.all(.typeMetadata).lazy.flatMap { sb in stride(from: sb.buffer.baseAddress!, to: sb.buffer.baseAddress! + sb.buffer.count, by: SWTTypeMetadataRecordByteCount).lazy .compactMap { swt_getType(fromTypeMetadataRecord: $0, ifNameContains: nameSubstring) }