Describe the Bug
Memo:
- pyrefly check
- pyrefly 0.46.1
- Python 3.14.0
Extending the type alias created with a type statement or TypeAliasType, pyrefly gives the error as shown below:
''' Type statement '''
type TA = int
''' Type statement '''
''' TypeAliasType '''
# from typing import TypeAliasType
# TA = TypeAliasType('TA', value=int)
''' TypeAliasType '''
class Cls(TA): pass # Error
ERROR Cannot use scoped type alias TA as a base class. Use a legacy type alias instead: TA: TypeAlias = type[int]
But extending the type alias created with TypeAlias or an assignment statement, pyrefly doesn't give error as shown below so error should also occur for consistency:
''' TypeAlias '''
from typing import TypeAlias
TA: TypeAlias = int
''' TypeAlias '''
''' Assignment statement '''
# TA = int
''' Assignment statement '''
class Cls(TA): pass # No error
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response