[Runtime] Correctly match demangle tree for generic Objective-C classes.

When we encounter the demangle tree for a bound generic class type, look
through the "Type" node of the child tree before checking whether we
have an Objective-C class name. If we do have an Objective-C class name,
there is no way to preserve the generic arguments, so we ignore them and
return the (non-generic) class type.

Fixes rdar://problem/47028102.
This commit is contained in:
Doug Gregor
2019-01-03 11:12:13 -08:00
parent c8b03fd944
commit c999ad0947
2 changed files with 12 additions and 2 deletions

View File

@@ -108,5 +108,9 @@ DemangleToMetadataTests.test("runtime conformance check for @objc protocol inher
expectEqual(F<P3>.self, _typeByName("4main1FCyAA2P3PG")!)
}
DemangleToMetadataTests.test("Objective-C generics") {
expectEqual(NSArray.self, _typeByName("So7NSArrayCySo8NSStringCG")!)
}
runAllTests()