@@ -16,24 +16,49 @@ func _recordIssue(
1616 guard let function = function ( for: " $s25IssueReportingTestSupport07_recordA0ypyF " )
1717 else {
1818 #if DEBUG && canImport(Darwin)
19- guard
20- let record = unsafeBitCast (
21- symbol: " $s7Testing5IssueV6record_14sourceLocationAcA7CommentVSg_AA06SourceE0VtFZ " ,
22- in: " Testing " ,
23- to: ( @convention( thin) ( Any? , SourceLocation) - > Issue) . self
19+ #if compiler(>=6.2)
20+ guard
21+ let record = unsafeBitCast (
22+ symbol: """
23+ $s7Testing5IssueV6record_8severity14sourceLocationAcA7CommentVSg_AC8SeverityOAA06Sour \
24+ ceF0VtFZ
25+ """ ,
26+ in: " Testing " ,
27+ to: ( @convention( thin) ( Any? , Any, SourceLocation) - > Issue) . self
28+ )
29+ else { return }
30+
31+ var comment : Any ?
32+ if let message {
33+ var c = UnsafeMutablePointer < Comment > . allocate ( capacity: 1 ) . pointee
34+ c. rawValue = message
35+ comment = c
36+ }
37+ _ = record (
38+ comment,
39+ Issue . Severity. error, // TODO: Support other severities?
40+ SourceLocation ( fileID: fileID, _filePath: filePath, line: line, column: column)
2441 )
25- else { return }
42+ #else
43+ guard
44+ let record = unsafeBitCast (
45+ symbol: " $s7Testing5IssueV6record_14sourceLocationAcA7CommentVSg_AA06SourceE0VtFZ " ,
46+ in: " Testing " ,
47+ to: ( @convention( thin) ( Any? , SourceLocation) - > Issue) . self
48+ )
49+ else { return }
2650
27- var comment : Any ?
28- if let message {
29- var c = UnsafeMutablePointer < Comment > . allocate ( capacity: 1 ) . pointee
30- c. rawValue = message
31- comment = c
32- }
33- _ = record (
34- comment,
35- SourceLocation ( fileID: fileID, _filePath: filePath, line: line, column: column)
36- )
51+ var comment : Any ?
52+ if let message {
53+ var c = UnsafeMutablePointer < Comment > . allocate ( capacity: 1 ) . pointee
54+ c. rawValue = message
55+ comment = c
56+ }
57+ _ = record (
58+ comment,
59+ SourceLocation ( fileID: fileID, _filePath: filePath, line: line, column: column)
60+ )
61+ #endif
3762 #else
3863 printError (
3964 """
@@ -188,7 +213,7 @@ func _withKnownIssue(
188213 let withKnownIssue = unsafeBitCast (
189214 symbol: """
190215 $s7Testing14withKnownIssue_14isIntermittent9isolation14sourceLocation_yAA7CommentVSg_ \
191- SbScA_pSgYiAA06SourceI0VyyYaKXEtYaF
216+ SbScA_pSgYiAA06SourceI0VyyYaKXEtYaFTu
192217 """ ,
193218 in: " Testing " ,
194219 to: ( @convention( thin) (
@@ -350,7 +375,9 @@ func _currentTest() -> _Test? {
350375 var value : __Expression
351376 }
352377 indirect case functionCall(
353- value: __Expression ? , functionName: String , arguments: [ FunctionCallArgument ]
378+ value: __Expression ? ,
379+ functionName: String ,
380+ arguments: [ FunctionCallArgument ]
354381 )
355382 indirect case propertyAccess( value: __Expression , keyPath: __Expression )
356383 indirect case negation( _ expression: __Expression , isParenthetical: Bool )
@@ -407,17 +434,34 @@ func _currentTest() -> _Test? {
407434 enum Kind : Sendable {
408435 case unconditional
409436 indirect case expectationFailed( _ expectation: Expectation )
410- indirect case confirmationMiscounted( actual: Int , expected: Int )
411- indirect case confirmationOutOfRange( actual: Int , expected: any ExpectedCount )
437+ #if compiler(>=6.2)
438+ indirect case confirmationMiscounted( actual: Int , expected: any RangeExpression & Sendable )
439+ #else
440+ indirect case confirmationMiscounted( actual: Int , expected: Int )
441+ indirect case confirmationOutOfRange( actual: Int , expected: any ExpectedCount )
442+ #endif
412443 indirect case errorCaught( _ error: any Error )
413444 indirect case timeLimitExceeded( timeLimitComponents: ( seconds: Int64 , attoseconds: Int64 ) )
414445 case knownIssueNotRecorded
415446 case apiMisused
416447 case system
417448 }
418449 var kind : Kind
450+ #if compiler(>=6.2)
451+ enum Severity : Sendable {
452+ case warning
453+ case error
454+ }
455+ var severity : Severity
456+ #endif
419457 var comments : [ Comment ]
420458 var sourceContext : SourceContext
459+ #if compiler(>=6.2)
460+ struct KnownIssueContext : Sendable {
461+ public var comment : Comment ?
462+ }
463+ var knownIssueContext : KnownIssueContext ? = nil
464+ #endif
421465 }
422466
423467 private struct SourceContext: Sendable {
@@ -523,7 +567,7 @@ func _currentTest() -> _Test? {
523567 > = LockIsolated ( [ : ] )
524568 var fullyQualifiedNameComponents : [ String ] {
525569 switch _kind {
526- case let . type( type) :
570+ case . type( let type) :
527571 if let cachedResult = Self
528572 . _fullyQualifiedNameComponentsCache. withLock ( { $0 [ ObjectIdentifier ( type) ] } )
529573 {
@@ -541,7 +585,7 @@ func _currentTest() -> _Test? {
541585 }
542586 return result
543587
544- case let . nameOnly( fullyQualifiedComponents, _, _) :
588+ case . nameOnly( let fullyQualifiedComponents, _, _) :
545589 return fullyQualifiedComponents
546590 }
547591 }
0 commit comments