DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
http://docs.basedpyright.com/
Other
601 stars 12 forks source link

Strange error with union generic thing #443

Open KotlinIsland opened 1 week ago

KotlinIsland commented 1 week ago
from typing import Sequence

def f1[T](l: Sequence[T]) -> list[T]:...
def f2[T](l: list[T]) -> list[T]:...

def main(data: list[int] | list[str]):     
    reveal_type(f1(data)) # list[int | str], expected list[int] | list[str]
    reveal_type(f2(data)) # list[int] + errors, expected list[int] | list[str]