Skip to content

Commit

Permalink
add new required method of ExpressionVisitor
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Jan 30, 2025
1 parent 6fa8c72 commit 4eaff26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lint/redundant_cast_analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ func (d *CheckCastVisitor) VisitStringExpression(_ *ast.StringExpression) bool {
return d.isTypeRedundant(sema.StringType, d.targetType)
}

func (d *CheckCastVisitor) VisitStringTemplateExpression(_ *ast.StringTemplateExpression) bool {
return d.isTypeRedundant(sema.StringType, d.targetType)
}

func (d *CheckCastVisitor) VisitCastingExpression(_ *ast.CastingExpression) bool {
// This is already covered under Case-I: where expected type is same as casted type.
// So skip checking it here to avid duplicate errors.
Expand Down

0 comments on commit 4eaff26

Please sign in to comment.