Skip to content

1.1.412 regression - Type "TypeAliasType" cannot be assigned to type variable when assigning generic with type alias to a TypeForm #11633

Description

@DetachHead

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    addressed in next versionIssue is fixed and will appear in next published versionbugSomething isn't workingregression

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions