@@ -236,8 +236,9 @@ public func __checkEscapedCondition(
236236 isRequired: Bool ,
237237 sourceLocation: SourceLocation
238238) -> Result < Void , any Error > {
239- var expectationContext = __ExpectationContext ( )
240- expectationContext. sourceCode [ . root] = sourceCode
239+ let expectationContext = __ExpectationContext (
240+ sourceCode: [ . root: sourceCode] ,
241+ )
241242
242243 return check (
243244 condition,
@@ -265,8 +266,9 @@ public func __checkEscapedCondition<T>(
265266 isRequired: Bool ,
266267 sourceLocation: SourceLocation
267268) -> 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+ )
270272
271273 let result = check (
272274 optionalValue != nil ,
@@ -394,8 +396,9 @@ public func __checkClosureCall(
394396 mismatchExplanationValue = " an error was thrown when none was expected: \( _description ( of: error) ) "
395397 }
396398
397- var expectationContext = __ExpectationContext ( )
398- expectationContext. sourceCode [ . root] = sourceCode
399+ let expectationContext = __ExpectationContext (
400+ sourceCode: [ . root: sourceCode] ,
401+ )
399402 return check (
400403 success,
401404 expectationContext: expectationContext,
@@ -434,8 +437,9 @@ public func __checkClosureCall(
434437 mismatchExplanationValue = " an error was thrown when none was expected: \( _description ( of: error) ) "
435438 }
436439
437- var expectationContext = __ExpectationContext ( )
438- expectationContext. sourceCode [ . root] = sourceCode
440+ let expectationContext = __ExpectationContext (
441+ sourceCode: [ . root: sourceCode] ,
442+ )
439443 return check (
440444 success,
441445 expectationContext: expectationContext,
@@ -520,8 +524,9 @@ public func __checkClosureCall<R>(
520524 isRequired: Bool ,
521525 sourceLocation: SourceLocation
522526) -> Result < ( any Error ) ? , any Error > {
523- var expectationContext = __ExpectationContext ( )
524- expectationContext. sourceCode [ . root] = sourceCode
527+ var expectationContext = __ExpectationContext (
528+ sourceCode: [ . root: sourceCode] ,
529+ )
525530
526531 var errorMatches = false
527532 var mismatchExplanationValue : String ? = nil
@@ -574,8 +579,9 @@ public func __checkClosureCall<R>(
574579 isolation: isolated ( any Actor ) ? = #isolation,
575580 sourceLocation: SourceLocation
576581) async -> Result < ( any Error ) ? , any Error > {
577- var expectationContext = __ExpectationContext ( )
578- expectationContext. sourceCode [ . root] = sourceCode
582+ var expectationContext = __ExpectationContext (
583+ sourceCode: [ . root: sourceCode] ,
584+ )
579585
580586 var errorMatches = false
581587 var mismatchExplanationValue : String ? = nil
0 commit comments