You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
From revive/testdata/constant-logical-expr.go:
func foo3(f float64) bool { return f <= f } // MATCH /expression always evaluates to false/
func foo4(f float64) bool { return f >= f } // MATCH /expression always evaluates to false/
But, for a binary expression with both operands being equal, it is expected that token.{EQL,LEQ,GEQ} should return true instead of false.
To Reproduce
Look at the testdata/constant-logical-expr.go and the implementation for constant-logical-expr. No need to reproduce it as it can be seen clearly from the example I've presented.
Expected behavior
func foo3(f float64) bool { return f <= f } // MATCH /expression always evaluates to true/
func foo4(f float64) bool { return f >= f } // MATCH /expression always evaluates to true/
Desktop (please complete the following information):
OS: Mac OSX
Go 1.17.6
The text was updated successfully, but these errors were encountered:
shmsr
changed the title
Improve handling for token.{NEQ,GEQ} for constant-logical-expr lint
Improve handling for token.{LEQ,GEQ} for constant-logical-expr lint
Feb 26, 2022
Describe the bug
From
revive/testdata/constant-logical-expr.go
:But, for a binary expression with both operands being equal, it is expected that
token.{EQL,LEQ,GEQ}
should returntrue
instead offalse
.To Reproduce
Look at the
testdata/constant-logical-expr.go
and the implementation forconstant-logical-expr
. No need to reproduce it as it can be seen clearly from the example I've presented.Expected behavior
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: