Skip to content

error[invalid-type-arguments] for TypeAlias involving ParamSpec Concatentate #2024

@GalHorowitz

Description

@GalHorowitz

Summary

Example code:

from typing import Callable, Concatenate, ParamSpec, TypeAlias, TypeVar

T = TypeVar("T")
P = ParamSpec("P")

A: TypeAlias = Callable[Concatenate[bool, P], T]
B: TypeAlias = T | A[P, T]
C: TypeAlias = B[T, []]

Result of running ty check:

error[invalid-type-arguments]: No type argument provided for required type variable `T`
 --> ty_test.py:8:16
  |
6 | A: TypeAlias = Callable[Concatenate[bool, P], T]
7 | B: TypeAlias = T | A[P, T]
8 | C: TypeAlias = B[T, []]
  |                ^^^^^^^^
  |
info: rule `invalid-type-arguments` is enabled by default

Version

ty 0.0.2 (4283557 2025-12-16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    genericsBugs or features relating to ty's generics implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions