pyrefly
pyrefly copied to clipboard
Check for `__bool__` for if/while conditions
Describe the Bug
Minimal repro:
class NotBoolable:
__bool__: int = 3
if NotBoolable():
pass
Actual: no error
Expected: NotBoolable() is not convertible to bool
Sandbox Link
https://pyrefly.org/sandbox/?code=MYGwhgzhAEByD2AXAQve4BGICmAuAUNEdAPokZohm7QCWAdotALzQDM++tAZnEqujBZsACgCUBYtAAOkCEA
(Only applicable for extension issues) IDE Information
No response
@martindemello is working on this.
fixed by 8ec4bca