File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,7 @@ func _childProcess() {
629
629
630
630
#if _runtime(_ObjC)
631
631
objc_setUncaughtExceptionHandler {
632
- let exception = $0 ! as AnyObject
632
+ let exception = ( $0 as Optional ) ! as AnyObject
633
633
var stderr = _Stderr ( )
634
634
let maybeNSException =
635
635
unsafeBitCast ( exception, to: _StdlibUnittestNSException. self)
Original file line number Diff line number Diff line change @@ -27,13 +27,17 @@ public func withOverriddenLocaleCurrentLocale<Result>(
27
27
_ temporaryLocale: NSLocale ,
28
28
_ body: ( ) -> Result
29
29
) -> Result {
30
- let oldMethod = class_getClassMethod (
31
- NSLocale . self, #selector( getter: NSLocale . current) )
32
- precondition ( oldMethod != nil , " could not find +[Locale currentLocale] " )
30
+ guard let oldMethod = class_getClassMethod (
31
+ NSLocale . self, #selector( getter: NSLocale . current) ) as Optional
32
+ else {
33
+ _preconditionFailure ( " could not find +[Locale currentLocale] " )
34
+ }
33
35
34
- let newMethod = class_getClassMethod (
35
- NSLocale . self, #selector( NSLocale . _swiftUnittest_currentLocale) )
36
- precondition ( newMethod != nil , " could not find +[Locale _swiftUnittest_currentLocale] " )
36
+ guard let newMethod = class_getClassMethod (
37
+ NSLocale . self, #selector( NSLocale . _swiftUnittest_currentLocale) ) as Optional
38
+ else {
39
+ _preconditionFailure ( " could not find +[Locale _swiftUnittest_currentLocale] " )
40
+ }
37
41
38
42
precondition ( _temporaryLocaleCurrentLocale == nil ,
39
43
" nested calls to withOverriddenLocaleCurrentLocale are not supported " )
You can’t perform that action at this time.
0 commit comments