         guard let (move, promotion, attackers) = _undoHistory.popLast() else {
             return nil
         }
-        try! _execute(move: move, promotion: promotion.map { p in { p } })
+        if let promotion = promotion {
+            try! _execute(move: move, promotion: { promotion })
+        } else {
+            try! _execute(move: move)
+        }
         attackersToKing = attackers
         return move
     }


        let player = playerTurn
        for moveSquare in movesBitboard.squares {
            try! _execute(move: square >>> moveSquare, promotion: nil)
            if board.attackersToKing(for: player) != 0 {
                movesBitboard[moveSquare] = false
            }

    /// - Throws: `MoveExecutionError` if `move` is illegal or if `promotion` is invalid.
    public func execute(move move: Move, promotion: Piece) throws {
        try execute(move: move, promotion: { promotion })
    }

    /// Executes `move`, updating the state for `self`.
    ///
    /// - Parameter move: The move to be executed.
    ///
    /// - Throws: `MoveExecutionError` if `move` is illegal.
    public func execute(move move: Move) throws {
        try execute(move: move, promotion: .Queen(playerTurn))
    }

    /// Returns the last move on the move stack, if any.
