         }
 
         switch option {
-        case _ as AutoReadOption:
+        case is AutoReadOption:
             return autoRead as! T.OptionType
-        case _ as SocketOption:
-            let optionValue = option as! SocketOption
-
+        case let optionValue as SocketOption:
             // SO_REUSEADDR and SO_REUSEPORT are handled here.
             switch optionValue.value {
             case (SOL_SOCKET, SO_REUSEADDR):


        // TODO: Many more channel options, both from NIO and Network.framework.
        switch option {
        case _ as AutoReadOption:
            // AutoRead is currently mandatory for TS listeners.
            if value as! AutoReadOption.OptionType == false {
                throw ChannelError.operationUnsupported
            }
        case _ as SocketOption:
            let optionValue = option as! SocketOption

            // SO_REUSEADDR and SO_REUSEPORT are handled here.
            switch optionValue.value {
            case (SOL_SOCKET, SO_REUSEADDR):

    }

    public func doClose0(error: Error) {
        // Step 1: tell the networking stack (if created) that we're done.
        if let listener = self.nwListener {
            listener.cancel()
        }
        
        // Step 2: fail any pending bind promise.
        if let pendingBind = self.bindPromise {
            self.bindPromise = nil
            pendingBind.fail(error: error)
