Skip to content

Commit 7f550dd

Browse files
authored
Merge pull request #560 from Quick/revert-537-noescape-workaround
Revert "🐛Workaround to noescape bug in Xcode 10 beta 1"
2 parents b731d81 + 032e26a commit 7f550dd

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

Sources/Nimble/Adapters/AssertionRecorder.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ public func withAssertionHandler(_ tempAssertionHandler: AssertionHandler, closu
5050
environment.assertionHandler = oldRecorder
5151
}))
5252
environment.assertionHandler = tempAssertionHandler
53-
// TEMP: withoutActuallyEscaping is workaround to Radar 40857699
54-
// https://openradar.appspot.com/radar?id=5595735974215680
55-
withoutActuallyEscaping(closure) { escapable in
56-
capturer.tryBlock {
57-
try! escapable()
58-
}
53+
capturer.tryBlock {
54+
try! closure()
5955
}
6056
}
6157

Sources/NimbleObjectiveC/NMBExceptionCapture.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@
44
@interface NMBExceptionCapture : NSObject
55

66
- (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally;
7-
8-
/**
9-
TEMP: unsafeBlock should be annotated with __attribute__((noescape)). This was removed
10-
as a workaround to Radar 40857699 https://openradar.appspot.com/radar?id=5595735974215680
11-
12-
@param unsafeBlock Closure to run inside an @try block.
13-
*/
14-
- (void)tryBlock:(void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:));
7+
- (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:));
158

169
@end
1710

Sources/NimbleObjectiveC/NMBExceptionCapture.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnul
1616
return self;
1717
}
1818

19-
- (void)tryBlock:(void(^ _Nonnull)(void))unsafeBlock {
19+
- (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock {
2020
@try {
2121
unsafeBlock();
2222
}

0 commit comments

Comments
 (0)