|
24 | 24 | #include "swift/AST/ASTVisitor.h"
|
25 | 25 | #include "swift/AST/ClangSwiftTypeCorrespondence.h"
|
26 | 26 | #include "swift/AST/Comment.h"
|
| 27 | +#include "swift/AST/ConformanceLookup.h" |
27 | 28 | #include "swift/AST/Decl.h"
|
28 | 29 | #include "swift/AST/ExistentialLayout.h"
|
29 | 30 | #include "swift/AST/ForeignAsyncConvention.h"
|
@@ -2155,16 +2156,16 @@ class DeclAndTypePrinter::Implementation
|
2155 | 2156 | auto proto = ctx.getProtocol(KnownProtocolKind::ObjectiveCBridgeable);
|
2156 | 2157 | if (!proto) return nullptr;
|
2157 | 2158 |
|
| 2159 | + auto declaredType = nominal->getDeclaredInterfaceType(); |
| 2160 | + |
2158 | 2161 | // Determine whether this nominal type is _ObjectiveCBridgeable.
|
2159 |
| - SmallVector<ProtocolConformance *, 2> conformances; |
2160 |
| - if (!nominal->lookupConformance(proto, conformances)) |
| 2162 | + auto conformance = lookupConformance(declaredType, proto); |
| 2163 | + if (!conformance) |
2161 | 2164 | return nullptr;
|
2162 | 2165 |
|
2163 | 2166 | // Dig out the Objective-C type.
|
2164 |
| - auto conformance = conformances.front(); |
2165 |
| - Type objcType = ProtocolConformanceRef(conformance).getTypeWitnessByName( |
2166 |
| - nominal->getDeclaredType(), |
2167 |
| - ctx.Id_ObjectiveCType); |
| 2167 | + Type objcType = conformance.getTypeWitnessByName( |
| 2168 | + declaredType, ctx.Id_ObjectiveCType); |
2168 | 2169 |
|
2169 | 2170 | // Dig out the Objective-C class.
|
2170 | 2171 | return objcType->getClassOrBoundGenericClass();
|
|
0 commit comments