[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:
Doug Gregor
2018-01-10 16:46:12 -08:00
parent c302042dc5
commit 9916fdf17e
2 changed files with 45 additions and 5 deletions

View File

@@ -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()