-
Notifications
You must be signed in to change notification settings - Fork 281
Open
Open
Copy link
Labels
Description
Describe the Bug
from typing import Callable, overload, reveal_type
@overload
def foo(x: int) -> int: ...
@overload
def foo(x: str) -> str: ...
def foo(x: int | str) -> int | str: ...
def copy[A, B](c: Callable[[A], B]) -> Callable[[A], B]: ...
foo_copy = copy(foo)
reveal_type(foo_copy) # (int) -> int
foo_copy(1)
foo_copy("42") # should not error hereThis is minimised from the conformance test issue in #2450
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable