Skip to content

Commit 0d41e00

Browse files
authored
Merge pull request swiftlang#63074 from xedin/rdar-104354485
[AST] Adjust `getBridgedToObjC` to produce only valid witness types
2 parents 054bae5 + ba0f1e9 commit 0d41e00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/AST/ASTContext.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5464,7 +5464,10 @@ Type ASTContext::getBridgedToObjC(const DeclContext *dc, Type type,
54645464
*bridgedValueType = type;
54655465

54665466
// Find the Objective-C class type we bridge to.
5467-
return conformance.getTypeWitnessByName(type, Id_ObjectiveCType);
5467+
Type witnessTy = conformance.getTypeWitnessByName(type, Id_ObjectiveCType);
5468+
// If Objective-C import is broken, witness type would be a dependent member
5469+
// with `<<error type>>` base.
5470+
return (witnessTy && !witnessTy->hasError()) ? witnessTy : Type();
54685471
}
54695472

54705473
// Do we conform to Error?

0 commit comments

Comments
 (0)