Daemon does not progate change from decorated to async function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This fine-grained incremental test case fails (no error on second run):
[case testDecoratedToAsyncReExported]
from mm import f
x: int = f()
[file mm.py]
from m import f
[file m.py]
from d import singleton
@singleton
def f() -> int:
return 0
[file m.py.2]
async def f() -> str:
return 'x'
[file d.py]
from typing import Callable
class Singleton:
def __call__(self) -> int:
return 0
def singleton(f: Callable[[], int]) -> Singleton: pass
[out]
==
main:2: error: Incompatible types in assignment (expression has type "Coroutine[Any, Any, str]", variable has type "int")
It seems necessary to have a re-export, a decorator, and an async function for this to work. Also changing the return type of the functions seems required. I have no idea so far why this corner case fails.
This fails in 0.971 so it's not a recent regression.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the testDecoratedToAsyncReExported case in the fine-grained incremental test harness, using the listed mm.py, m.py, and d.py snapshots. Trace why the second run produces no error; done means the second run reports the shown incompatible-types diagnostic without regressing related incremental tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100