Skip to content

Commit 8fee0af

Browse files
committed
[cxx-interop] Allow initializing std::function from Swift closures
This adds a Swift initializer to instantiations of `std::function` that accepts a Swift closure with `@convention(c)`. rdar://103979602
1 parent 7645a40 commit 8fee0af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Interop/Cxx/stdlib/use-std-function.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import CxxStdlib
1313

1414
var StdFunctionTestSuite = TestSuite("StdFunction")
1515

16-
StdFunctionTestSuite.test("FunctionIntToInt init empty") {
16+
StdFunctionTestSuite.test("FunctionIntToInt.init()") {
1717
let f = FunctionIntToInt()
1818
expectTrue(isEmptyFunction(f))
1919

2020
let copied = f
2121
expectTrue(isEmptyFunction(copied))
2222
}
2323

24-
StdFunctionTestSuite.test("FunctionIntToInt call") {
24+
StdFunctionTestSuite.test("FunctionIntToInt.callAsFunction") {
2525
let f = getIdentityFunction()
2626
expectEqual(123, f(123))
2727
}

0 commit comments

Comments
 (0)