ruff/crates/red_knot_python_semantic/resources/mdtest/expression
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
..
attribute.md [red-knot] Review remaining 'possibly unbound' call sites (#14284) 2024-11-11 20:48:49 +01:00
boolean.md [red-knot] Format mdtest Python snippets more concisely (#13905) 2024-10-24 11:09:31 +00:00
if.md Support typing.NoReturn and typing.Never (#14559) 2024-11-25 21:37:55 +00:00