[Mangled name -> metadata] Handle import-as-member types.

When import-as-member takes a C type and imports it as a nested type,
we end up with a nominal type descriptor for a nested type, but the
mangled name remains "flat". Cope with inconsistency to allow
_typeByMangledName() to handle such nested types.
This commit is contained in:
Doug Gregor
2018-01-19 23:32:51 -08:00
parent ca76c76272
commit 2c9ad900ae
2 changed files with 5 additions and 4 deletions

View File

@@ -60,12 +60,12 @@ DemangleToMetadataTests.test("Imported swift_wrapper types") {
_typeByMangledName("So21NSURLFileResourceTypea")!)
}
// FIXME: Shouldn't need this?
extension URLSessionTask.State: P2 { }
DemangleToMetadataTests.test("Imported enum types") {
// FIXME: Should work
// expectEqual(NSURLSessionTask.State.self,
// _typeByMangledName("So21NSURLSessionTaskStateV")!)
expectEqual(NSURLSessionTask.State.self,
_typeByMangledName("So21NSURLSessionTaskStateV")!)
}
runAllTests()