@@ -236,8 +236,9 @@ public func __checkEscapedCondition(
236
236
isRequired: Bool ,
237
237
sourceLocation: SourceLocation
238
238
) -> Result < Void , any Error > {
239
- var expectationContext = __ExpectationContext ( )
240
- expectationContext. sourceCode [ . root] = sourceCode
239
+ let expectationContext = __ExpectationContext (
240
+ sourceCode: [ . root: sourceCode] ,
241
+ )
241
242
242
243
return check (
243
244
condition,
@@ -265,8 +266,9 @@ public func __checkEscapedCondition<T>(
265
266
isRequired: Bool ,
266
267
sourceLocation: SourceLocation
267
268
) -> Result < T , any Error > where T: ~ Copyable {
268
- var expectationContext = __ExpectationContext ( )
269
- expectationContext. sourceCode [ . root] = sourceCode
269
+ let expectationContext = __ExpectationContext (
270
+ sourceCode: [ . root: sourceCode] ,
271
+ )
270
272
271
273
let result = check (
272
274
optionalValue != nil ,
@@ -394,8 +396,9 @@ public func __checkClosureCall(
394
396
mismatchExplanationValue = " an error was thrown when none was expected: \( _description ( of: error) ) "
395
397
}
396
398
397
- var expectationContext = __ExpectationContext ( )
398
- expectationContext. sourceCode [ . root] = sourceCode
399
+ let expectationContext = __ExpectationContext (
400
+ sourceCode: [ . root: sourceCode] ,
401
+ )
399
402
return check (
400
403
success,
401
404
expectationContext: expectationContext,
@@ -434,8 +437,9 @@ public func __checkClosureCall(
434
437
mismatchExplanationValue = " an error was thrown when none was expected: \( _description ( of: error) ) "
435
438
}
436
439
437
- var expectationContext = __ExpectationContext ( )
438
- expectationContext. sourceCode [ . root] = sourceCode
440
+ let expectationContext = __ExpectationContext (
441
+ sourceCode: [ . root: sourceCode] ,
442
+ )
439
443
return check (
440
444
success,
441
445
expectationContext: expectationContext,
@@ -520,8 +524,9 @@ public func __checkClosureCall<R>(
520
524
isRequired: Bool ,
521
525
sourceLocation: SourceLocation
522
526
) -> Result < ( any Error ) ? , any Error > {
523
- var expectationContext = __ExpectationContext ( )
524
- expectationContext. sourceCode [ . root] = sourceCode
527
+ var expectationContext = __ExpectationContext (
528
+ sourceCode: [ . root: sourceCode] ,
529
+ )
525
530
526
531
var errorMatches = false
527
532
var mismatchExplanationValue : String ? = nil
@@ -574,8 +579,9 @@ public func __checkClosureCall<R>(
574
579
isolation: isolated ( any Actor ) ? = #isolation,
575
580
sourceLocation: SourceLocation
576
581
) async -> Result < ( any Error ) ? , any Error > {
577
- var expectationContext = __ExpectationContext ( )
578
- expectationContext. sourceCode [ . root] = sourceCode
582
+ var expectationContext = __ExpectationContext (
583
+ sourceCode: [ . root: sourceCode] ,
584
+ )
579
585
580
586
var errorMatches = false
581
587
var mismatchExplanationValue : String ? = nil
0 commit comments