Skip to content

Commit 400063e

Browse files
committed
SIL: Handle incomplete conformances in TypeConverter::getLoweredCBridgedType()
Currently Sema completes all _ObjectiveCBridgeable conformances it thinks are needed in SILGen and runtime dynamic casts, but that's about to change. Make sure SIL passes a LazyResolver down so that if a conformance doesn't have a type witness for _ObjectiveCType yet, one can be resolved. Note that in practice, ClangImporter-synthesized conformances use a special LazyMemberLoader implementation to fill in type witnesses without any intervention from the type checker. However, that might go away now that we have a long-lived type checker instance. Furthermore, various tests use -enable-source-import and start to fail once Sema no longer completes _ObjectiveCBridgeable conformances.
1 parent 472787b commit 400063e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SIL/Bridging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ Type TypeConverter::getLoweredCBridgedType(AbstractionPattern pattern,
224224
ProtocolConformanceRef::getTypeWitnessByName(
225225
t, ProtocolConformanceRef(conformance),
226226
M.getASTContext().Id_ObjectiveCType,
227-
nullptr);
227+
M.getASTContext().getLazyResolver());
228228
assert(bridgedTy && "Missing _ObjectiveCType witness?");
229229
if (purpose == BridgedTypePurpose::ForResult && clangTy)
230230
bridgedTy = OptionalType::get(bridgedTy);

0 commit comments

Comments
 (0)