Closed
Description
- version: 7.3.0
When creating a union which has overlapping types, the inference fails. Either this should throw an error, or it should be inferred correctly.
from typing import TypeVar, Union, Iterable, List
T = TypeVar("T")
def foo(test: Union[T, List[T]]):
pass
foo([1]) # Fails with incompatible type List[<nothing>]
- Example of misuse here
Metadata
Metadata
Assignees
Labels
No labels