% swift -version
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.4.0
% swift build
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:233:54: warning: will never be executed
return mapError(ImmediateExecutionContext) { $0 as! E } // future will never fail, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:233:52: note: '$0' is uninhabited, so this function body can never be executed
return mapError(ImmediateExecutionContext) { $0 as! E } // future will never fail, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:265:49: warning: will never be executed
return map(ImmediateExecutionContext) { $0 as! T } // future will never succeed, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:265:47: note: '$0' is uninhabited, so this function body can never be executed
return map(ImmediateExecutionContext) { $0 as! T } // future will never succeed, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:233:54: warning: will never be executed
return mapError(ImmediateExecutionContext) { $0 as! E } // future will never fail, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:233:52: note: '$0' is uninhabited, so this function body can never be executed
return mapError(ImmediateExecutionContext) { $0 as! E } // future will never fail, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:265:49: warning: will never be executed
return map(ImmediateExecutionContext) { $0 as! T } // future will never succeed, so this map block will never get called
^
BrightFutures/Sources/BrightFutures/AsyncType+ResultType.swift:265:47: note: '$0' is uninhabited, so this function body can never be executed
return map(ImmediateExecutionContext) { $0 as! T } // future will never succeed, so this map block will never get called
^
[17/17] Merging module BrightFutures
There is no way in Swift to suppress a warning on a line of code. This patch is not as clean as original functional code, but the warnings go away.
There is no way in Swift to suppress a warning on a line of code. This patch is not as clean as original functional code, but the warnings go away.