[ty] Use separate Rust types for bound and unbound type variables (#19796)

This PR creates separate Rust types for bound and unbound type
variables, as proposed in https://github.com/astral-sh/ty/issues/926.

Closes https://github.com/astral-sh/ty/issues/926

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
This commit is contained in:
Douglas Creager 2025-08-11 15:29:58 -04:00 committed by GitHub
parent f3f4db7104
commit dc84645c36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 846 additions and 560 deletions

View file

@ -102,7 +102,7 @@ def silence[T: type[BaseException]](
try:
func()
except exception_type as e:
reveal_type(e) # revealed: T'instance
reveal_type(e) # revealed: T'instance@silence
def silence2[T: (
type[ValueError],
@ -111,7 +111,7 @@ def silence2[T: (
try:
func()
except exception_type as e:
reveal_type(e) # revealed: T'instance
reveal_type(e) # revealed: T'instance@silence2
```
## Invalid exception handlers