-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
astral-sh/ruff
#21056Labels
Description
We currently silence diagnostics during multi-inference for overload arguments, but this doesn't work for standalone expressions.
from typing import overload
@overload
def f(_: str): ...
@overload
def f(_: str): ...
def f(_: str): ...
def _(a: object, b: object):
f(f"{'a' if a > b else 'b'}")error[unsupported-operator]: Operator `>` is not supported for types `object` and `object`
--> x.py:12:17
|
11 | def _(a: object, b: object):
12 | f(f"{'a' if a > b else 'b'}")
| ^^^^^
|
info: rule `unsupported-operator` is enabled by default
error[unsupported-operator]: Operator `>` is not supported for types `object` and `object`
--> x.py:12:17
|
11 | def _(a: object, b: object):
12 | f(f"{'a' if a > b else 'b'}")
| ^^^^^
Reactions are currently unavailable