Skip to content

Commit 1fe3f9f

Browse files
authored
Merge pull request #4357 from DougGregor/sr-2337-for-3.0
[3.0] SR-2377: Only try to extract embedded NSErrors when there is an Objective-C runtime
2 parents 3f91c30 + 0fa5ef0 commit 1fe3f9f

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)