ruff/crates/red_knot_python_semantic/resources/mdtest/binary
David Peter af988bf866
[red-knot] Detect division-by-zero in unions and intersections (#17157)
## Summary

With this PR, we emit a diagnostic for this case where
previously didn't:
```py
from typing import Literal

def f(m: int, n: Literal[-1, 0, 1]):
    # error: [division-by-zero] "Cannot divide object of type `int` by zero"
    return m / n
```

## Test Plan

New Markdown test
2025-04-02 18:21:27 +02:00
..
booleans.md [red-knot] add special case for float/complex (#16166) 2025-02-14 12:24:10 -08:00
classes.md Don't special-case class instances in binary expression inference (#15161) 2025-01-06 13:50:20 -05:00
custom.md [red-knot] Add missing imports in mdtests (#15869) 2025-02-03 09:27:29 +00:00
instances.md [red-knot] Decorators and properties (#17017) 2025-04-02 09:27:46 +02:00
integers.md [red-knot] Decorators and properties (#17017) 2025-04-02 09:27:46 +02:00
tuples.md [red-knot] fix: improve type inference for binary ops on tuples (#16725) 2025-03-14 12:29:57 +01:00
unions.md [red-knot] Detect division-by-zero in unions and intersections (#17157) 2025-04-02 18:21:27 +02:00