KotlinIsland / KotlinIsland/basedmypy

[arg-type] error in assignment of generic with unions

Open
#869 0 comments 0 reactions 0 assignees View on GitHub
upstream
Dominant language
Python
Stars
202
Forks
6
PR merge metrics
No merged PRs in 30d

Description

```py
from typing import Callable

def f[T](x: Callable[[], T] | Callable[[list[object]], T]) -> T: ...

a: list[int] | list[str] = f(list) # Argument 1 to "f" has incompatible type "type[list[_T]]"; expected "() -> Never | (list[object]) -> Never" [arg-type]
```

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Python reproducer and examining how the checker handles generic inference for the union of Callable signatures in this assignment. Trace the source path that emits the [arg-type] diagnostic; done means the example no longer reports the incompatible argument while preserving correct type checking.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.