Skip to content

Commit 4bd09ff

Browse files
committed
Disallow block convention on non ObjC interop
1 parent 2e8ae40 commit 4bd09ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/stdlib/_Runtime/Metadata/FunctionMetadata.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,13 @@ if #available(SwiftStdlib 5.9, *) {
120120

121121
expectEqual(fn11.convention, .c)
122122

123+
// Block calling conventions are only supported on platforms with an
124+
// ObjectiveC interop.
125+
#if canImport(ObjectiveC)
123126
let fn12 = Metadata((@convention(block) () -> Int).self).function
124127

125128
expectEqual(fn12.convention, .block)
129+
#endif
126130
}
127131
}
128132

0 commit comments

Comments
 (0)