mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Runtime] Support lookup of Objective-C protocols.
Protocols defined in Objective-C are mangled differently from Swift-defined protocols. Recognize this mangling and search for the appropriate Objective-C protocol using the Objective-C runtime.
This commit is contained in:
@@ -26,5 +26,11 @@ DemangleToMetadataTests.test("@objc protocols") {
|
||||
_typeByMangledName("yy4main2P1_pc")!)
|
||||
}
|
||||
|
||||
func f1_composition_NSCoding(_: NSCoding) { }
|
||||
|
||||
DemangleToMetadataTests.test("Objective-C protocols") {
|
||||
expectEqual(type(of: f1_composition_NSCoding), _typeByMangledName("yySo8NSCoding_pc")!)
|
||||
}
|
||||
|
||||
runAllTests()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user