Open
Description
Bug description
# pylint: disable=missing-docstring
from typing import TypeAlias, TypeVar
T = TypeVar("T")
Alias1: TypeAlias = list[T]
Alias2: TypeAlias = "list[T]"
x1: Alias1[int] # ok
x2: Alias2[int] # <= triggers E1126 (invalid-sequence-index)
Configuration
No response
Command used
pylint --rcfile /dev/null test.py
Pylint output
************* Module test
test.py:10:4: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
------------------------------------------------------------------
Your code has been rated at 1.67/10 (previous run: 1.67/10, +0.00)
Expected behavior
Should not emit warning.
I've also tested with pylint from the head of the main branch (eb33f8a).
Pylint version
pylint 3.2.7
astroid 3.2.4
Python 3.12.5 (main, Aug 7 2024, 10:47:46) [GCC 11.4.0]
OS / Environment
Ubuntu 22.04
Additional dependencies
No response