ruff/crates/red_knot_python_semantic/resources/mdtest/annotations
Shaygan Hooshyari 557d583e32
Support typing.NoReturn and typing.Never (#14559)
Fix #14558 
## Summary

- Add `typing.NoReturn` and `typing.Never` to known instances and infer
them as `Type::Never`
- Add `is_assignable_to` cases for `Type::Never`

I skipped emitting diagnostic for when a function is annotated as
`NoReturn` but it actually returns.

## Test Plan

Added tests from

https://github.com/python/typing/blob/main/conformance/tests/specialtypes_never.py
except from generics and checking if the return value of the function
and the annotations match.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Carl Meyer <carl@astral.sh>
2024-11-25 21:37:55 +00:00
..
never.md Support typing.NoReturn and typing.Never (#14559) 2024-11-25 21:37:55 +00:00
optional.md Understand typing.Optional in annotations (#14397) 2024-11-17 17:04:58 +00:00
starred.md [red-knot] Meta data for Type::Todo (#14500) 2024-11-21 09:59:47 +01:00
string.md Avoid inferring invalid expr types for string annotation (#14447) 2024-11-25 21:27:03 +05:30
union.md [red-knot] support typing.Union in type annotations (#14499) 2024-11-20 21:55:33 +00:00