Skip to content

Commit 60f5c7e

Browse files
committed
Moar
1 parent b92851b commit 60f5c7e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/Testing/Expectations/ExpectationContext+Pointers.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension __ExpectationContext {
2828
///
2929
/// - Warning: This function is used to implement the `#expect()` and
3030
/// `#require()` macros. Do not call it directly.
31-
@inlinable public func callAsFunction<P>(_ value: consuming P, _ id: __ExpressionID) -> P where P: _Pointer {
31+
@inlinable public func callAsFunction<P>(_ value: borrowing P, _ id: __ExpressionID) -> P where P: _Pointer {
3232
captureValue(value, id)
3333
}
3434

@@ -49,7 +49,7 @@ extension __ExpectationContext {
4949
///
5050
/// - Warning: This function is used to implement the `#expect()` and
5151
/// `#require()` macros. Do not call it directly.
52-
@inlinable public func callAsFunction(_ value: consuming String, _ id: __ExpressionID) -> String {
52+
@inlinable public func callAsFunction(_ value: borrowing String, _ id: __ExpressionID) -> String {
5353
captureValue(value, id)
5454
}
5555

@@ -70,7 +70,7 @@ extension __ExpectationContext {
7070
///
7171
/// - Warning: This function is used to implement the `#expect()` and
7272
/// `#require()` macros. Do not call it directly.
73-
@inlinable public func callAsFunction<E>(_ value: consuming Array<E>, _ id: __ExpressionID) -> Array<E> {
73+
@inlinable public func callAsFunction<E>(_ value: borrowing Array<E>, _ id: __ExpressionID) -> Array<E> {
7474
captureValue(value, id)
7575
}
7676

@@ -90,7 +90,7 @@ extension __ExpectationContext {
9090
/// - Warning: This function is used to implement the `#expect()` and
9191
/// `#require()` macros. Do not call it directly.
9292
@_disfavoredOverload
93-
@inlinable public func callAsFunction<T>(_ value: consuming T?, _ id: __ExpressionID) -> T? {
93+
@inlinable public func callAsFunction<T>(_ value: borrowing T?, _ id: __ExpressionID) -> T? {
9494
captureValue(value, id)
9595
}
9696
}

Sources/Testing/Expectations/ExpectationContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ extension __ExpectationContext {
380380
let result = captureValue(value, valueID) as? U
381381

382382
if result == nil {
383-
let correctType = Swift.type(of: value as Any)
383+
let correctType = Swift.type(of: (copy value) as Any)
384384
_ = captureValue(correctType, typeID)
385385
}
386386

0 commit comments

Comments
 (0)