Skip to content

Commit f27305a

Browse files
authored
Raise types(withNamesContaining:) to SPI rather than package. (#1004)
This PR makes `types(withNamesContaining:)` available as pre-deprecated SPI.
1 parent 23af7e5 commit f27305a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/_TestDiscovery/TestContentRecord.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,9 @@ private import _TestingInternals
223223
/// - nameSubstring: A string which the names of matching classes all contain.
224224
///
225225
/// - Returns: A sequence of Swift types whose names contain `nameSubstring`.
226-
///
227-
/// - Warning: Do not adopt this functionality in new code. It is for use by
228-
/// Swift Testing along its legacy discovery codepath only.
229-
package func types(withNamesContaining nameSubstring: String) -> some Sequence<Any.Type> {
226+
@_spi(Experimental) @_spi(ForToolsIntegrationOnly)
227+
@available(swift, deprecated: 100000.0, message: "Do not adopt this functionality in new code. It will be removed in a future release.")
228+
public func types(withNamesContaining nameSubstring: String) -> some Sequence<Any.Type> {
230229
SectionBounds.all(.typeMetadata).lazy.flatMap { sb in
231230
stride(from: sb.buffer.baseAddress!, to: sb.buffer.baseAddress! + sb.buffer.count, by: SWTTypeMetadataRecordByteCount).lazy
232231
.compactMap { swt_getType(fromTypeMetadataRecord: $0, ifNameContains: nameSubstring) }

0 commit comments

Comments
 (0)