Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "🐛Workaround to noescape bug in Xcode 10 beta 1" #560

Merged
merged 1 commit into from
Jul 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Sources/Nimble/Adapters/AssertionRecorder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ public func withAssertionHandler(_ tempAssertionHandler: AssertionHandler, closu
environment.assertionHandler = oldRecorder
}))
environment.assertionHandler = tempAssertionHandler
// TEMP: withoutActuallyEscaping is workaround to Radar 40857699
// https://openradar.appspot.com/radar?id=5595735974215680
withoutActuallyEscaping(closure) { escapable in
capturer.tryBlock {
try! escapable()
}
capturer.tryBlock {
try! closure()
}
}

Expand Down
9 changes: 1 addition & 8 deletions Sources/NimbleObjectiveC/NMBExceptionCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@
@interface NMBExceptionCapture : NSObject

- (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally;

/**
TEMP: unsafeBlock should be annotated with __attribute__((noescape)). This was removed
as a workaround to Radar 40857699 https://openradar.appspot.com/radar?id=5595735974215680

@param unsafeBlock Closure to run inside an @try block.
*/
- (void)tryBlock:(void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:));
- (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:));

@end

Expand Down
2 changes: 1 addition & 1 deletion Sources/NimbleObjectiveC/NMBExceptionCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ - (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnul
return self;
}

- (void)tryBlock:(void(^ _Nonnull)(void))unsafeBlock {
- (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock {
@try {
unsafeBlock();
}
Expand Down