mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 05:51:03 -05:00
Resolves https://github.com/astral-sh/ruff/issues/14547 by delegating narrowing to `E` for `bool(E)` where `E` is some expression. This change does not include other builtin class constructors which should also work in this position, like `int(..)` or `float(..)`, as the original issue does not mention these. It should be easy enough to add checks for these as well if we want to. I don't see a lot of markdown tests for malformed input, maybe there's a better place for the no args and too many args cases to go? I did see after the fact that it looks like this task was intended for a new hire.. my apologies. I got here from https://github.com/astral-sh/ruff/issues/13694, which is marked help-wanted. --------- Co-authored-by: David Peter <mail@david-peter.de>
Markdown files within the mdtest/ subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs integration test.
See crates/red_knot_test/README.md for documentation of this test format.