diff --git a/lint/redundant_cast_analyzer.go b/lint/redundant_cast_analyzer.go index e1e8e97c..38d08905 100644 --- a/lint/redundant_cast_analyzer.go +++ b/lint/redundant_cast_analyzer.go @@ -49,6 +49,10 @@ func (d *CheckCastVisitor) IsRedundantCast(expr ast.Expression, exprInferredType return ast.AcceptExpression[bool](expr, d) } +func (d *CheckCastVisitor) VisitVoidExpression(_ *ast.VoidExpression) bool { + return d.isTypeRedundant(sema.VoidType, d.targetType) +} + func (d *CheckCastVisitor) VisitBoolExpression(_ *ast.BoolExpression) bool { return d.isTypeRedundant(sema.BoolType, d.targetType) }