Then tell us:
- What language is this for? Python
- Which rule? S5655
- Why do you believe it’s a false-positive/false-negative?
- Because a bool is an int, and int passes. Also, mypy and pyright.
- SonarLint 4.2.2
# func expects a float
def fun(f: float) -> None:
print(1.0 + f)
# passing an int works
fun(1)
# passing a bool also works, but yields S5655
fun(True)
# but True is an int and thus should pass!
print(isinstance(True, int))