ruff/crates/red_knot_python_semantic/resources/mdtest/call
Carl Meyer 87d011e1bd
[red-knot] fix non-callable reporting for unions (#16387)
Minor follow-up to https://github.com/astral-sh/ruff/pull/16161

This `not_callable` flag wasn't functional, because it could never be
`false`. It was initialized to `true` and then only ever updated with
`|=`, which can never make it `false`.

Add a test that exercises the case where it _should_ be `false` (all of
the union elements are callable) but `bindings` is also empty (all union
elements have binding errors). Before this PR, the added test wrongly
emits a diagnostic that the union `Literal[f1] | Literal[f2]` is not
callable.

And add a test where a union call results in one binding error and one
not-callable error, where we currently give the wrong result (we show
only the binding error), with a TODO.

Also add TODO comments in a couple other tests where ideally we'd report
more than just one error out of a union call.

Also update the flag name to `all_errors_not_callable` to more clearly
indicate the semantics of the flag.
2025-02-26 07:06:04 -08:00
..
builtins.md Teach red-knot that `type(x)` is the same as `x.__class__` (#16301) 2025-02-21 21:05:48 +00:00
callable_instance.md [red-knot] Correct modeling of dunder calls (#16368) 2025-02-25 20:38:15 +01:00
constructor.md [red-knot] Format mdtest Python snippets more concisely (#13905) 2024-10-24 11:09:31 +00:00
dunder.md [red-knot] Correct modeling of dunder calls (#16368) 2025-02-25 20:38:15 +01:00
function.md [red-knot] Add support for `@classmethod`s (#16305) 2025-02-24 09:55:34 +01:00
getattr_static.md [red-knot] Method calls and the descriptor protocol (#16121) 2025-02-20 23:22:26 +01:00
invalid_syntax.md [red-knot] add call checking (#15200) 2025-01-07 20:39:45 +00:00
methods.md [red-knot] Better diagnostics for method calls (#16362) 2025-02-25 09:58:08 +01:00
union.md [red-knot] fix non-callable reporting for unions (#16387) 2025-02-26 07:06:04 -08:00