                 return super.visit(node)
             }
 
-            if let expression = pattern.expression.as(OptionalChainingExprSyntax.self) {
+            if let expression = pattern.expression.as(OptionalChainingExprSyntax.self),
+               !expression.expression.isDiscardAssignmentOrBoolLiteral {
                 let violationPosition = expression.questionMark.positionAfterSkippingLeadingTrivia
                 correctionPositions.append(violationPosition)
                 let newExpression = ExprSyntax(expression.withQuestionMark(nil))

                return
            }

            if let expression = pattern.expression.as(OptionalChainingExprSyntax.self) {
                violations.append(expression.questionMark.positionAfterSkippingLeadingTrivia)
            } else if let expression = pattern.expression.as(TupleExprSyntax.self) {
                let optionalChainingExpressions = expression.optionalChainingExpressions()

            case (_, _):
                break
            }
            """),
            // https://github.com/apple/swift/issues/61817
            Example("""
            switch bool {
            case true?:
              break
            case false?:
              break
            case .none:
              break
            }
            """, excludeFromDocumentation: true)
        ],
        triggeringExamples: [
            Example("""
