Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intersection paramspec never fail #691

Open
KotlinIsland opened this issue Jun 24, 2024 · 0 comments
Open

intersection paramspec never fail #691

KotlinIsland opened this issue Jun 24, 2024 · 0 comments
Labels
bug Something isn't working topic-intersection

Comments

@KotlinIsland
Copy link
Owner

from __future__ import annotations

from typing import Callable, Never

from basedtyping import P

class A: pass

def f(fn: Callable[P, object]): ...

a: A & Callable[[Never], object]
b: A & Callable[[object], object]

f(a)  # error: Argument 1 to "f" has incompatible type "A & (Never) -> object"; expected "(*Never, **Never) -> object"  [arg-type]
f(b)
@KotlinIsland KotlinIsland added bug Something isn't working topic-intersection labels Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working topic-intersection
Projects
None yet
Development

No branches or pull requests

1 participant