ruff/crates/ty_python_semantic/resources/mdtest/call
Carl Meyer 6b7adb0537
[ty] support PEP 613 type aliases (#21394)
Refs https://github.com/astral-sh/ty/issues/544

## Summary

Takes a more incremental approach to PEP 613 type alias support (vs
https://github.com/astral-sh/ruff/pull/20107). Instead of eagerly
inferring the RHS of a PEP 613 type alias as a type expression, infer it
as a value expression, just like we do for implicit type aliases, taking
advantage of the same support for e.g. unions and other type special
forms.

The main reason I'm following this path instead of the one in
https://github.com/astral-sh/ruff/pull/20107 is that we've realized that
people do sometimes use PEP 613 type aliases as values, not just as
types (because they are just a normal runtime assignment, unlike PEP 695
type aliases which create an opaque `TypeAliasType`).

This PR doesn't yet provide full support for recursive type aliases
(they don't panic, but they just fall back to `Unknown` at the recursion
point). This is future work.

## Test Plan

Added mdtests.

Many new ecosystem diagnostics, mostly because we
understand new types in lots of places.

Conformance suite changes are correct.

Performance regression is due to understanding lots of new
types; nothing we do in this PR is inherently expensive.
2025-11-20 17:59:35 -08:00
..
annotation.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
builtins.md [ty] Improve diagnostics when `NotImplemented` is called (#21523) 2025-11-19 19:27:12 +00:00
callable_instance.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
callables_as_descriptors.md [ty] Treat `Callable` dunder members as bound method descriptors (#20860) 2025-10-14 14:27:52 +02:00
constructor.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
dunder.md [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
dunder_import.md [ty] Make `__getattr__` available for `ModuleType` instances (#21450) 2025-11-14 13:59:14 +01:00
function.md [ty] Improve `invalid-argument-type` diagnostics where a union type was provided (#21044) 2025-10-23 13:16:21 +00:00
getattr_static.md [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
invalid_syntax.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
methods.md [ty] support PEP 613 type aliases (#21394) 2025-11-20 17:59:35 -08:00
never.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
open.md [ty] support PEP 613 type aliases (#21394) 2025-11-20 17:59:35 -08:00
overloads.md [ty] `dict` is not assignable to `TypedDict` (#21238) 2025-11-03 16:57:49 -05:00
replace.md [ty] Sync vendored typeshed stubs (#20658) 2025-10-01 10:11:48 +02:00
str_startswith.md [ty] `"foo".startswith` is not an instance of `types.MethodWrapperType` (#20317) 2025-09-10 11:14:26 +00:00
subclass_of.md [ty] Include synthesized arguments in displayed counts for `too-many-positional-arguments` (#18098) 2025-05-14 22:51:23 -04:00
union.md [ty] `dict` is not assignable to `TypedDict` (#21238) 2025-11-03 16:57:49 -05:00