Code sample in pyright playground
from typing_extensions import TypeForm
type Foo = int | str
def fn[T](value: TypeForm[T]): ...
class Bar[T: Foo]: ...
fn(Bar[Foo]) # error
Type "TypeAliasType" cannot be assigned to type variable "T@Bar"
Type "TypeAliasType" is not assignable to upper bound "Foo" for type variable "T@Bar"
Type "TypeAliasType" is not assignable to type "Foo"
"TypeAliasType" is not assignable to "int"
"TypeAliasType" is not assignable to "str" (reportInvalidTypeArguments)
Code sample in pyright playground