                 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))

    func optionalChainingExpressions() -> [OptionalChainingExprSyntax] {
        elementList
            .compactMap { $0.expression.as(OptionalChainingExprSyntax.self) }
            .filter { !$0.expression.is(DiscardAssignmentExprSyntax.self) }
    }
}

                return
            }

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