Skip to content

Commit f2ee3fd

Browse files
committed
[SILGen] SR-2377: Only try to extract embedded NSErrors when there is an Objective-C runtime.
1 parent d318c95 commit f2ee3fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILGen/SILGenConvert.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ ManagedValue SILGenFunction::emitExistentialErasure(
459459
// If we're erasing to the 'Error' type, we might be able to get an NSError
460460
// representation more efficiently.
461461
auto &ctx = getASTContext();
462-
if (conformances.size() == 1 &&
462+
if (ctx.LangOpts.EnableObjCInterop && conformances.size() == 1 &&
463463
conformances[0].getRequirement() == ctx.getErrorDecl() &&
464464
ctx.getNSErrorDecl()) {
465465
auto nsErrorDecl = ctx.getNSErrorDecl();

0 commit comments

Comments
 (0)