Describe the Bug
Note that there was a similar issue a few months ago: #1624. However, that seems to be a slightly different case. The comments there might aid you in debugging this one though. I don't believe this is a duplicate (esp considering that one was fixed months ago).
Pyrefly version: 0.57.1 (latest as of time of writing)
Python version: 3.13.1
The below code:
from abc import ABC, abstractmethod
class Issue(ABC):
@abstractmethod
async def fn(self):
raise NotImplementedError
incorrectly fails with
ERROR Abstract methods for async generators should use `def`, not `async def` [bad-function-definition]
Interestingly, this only happens when I raise an exception AND don't specify a return type. Replacing the raise NotImplementedError line with anything else (pass, docstring, actual code, ...) or adding a return type stops Pyrefly from complaining. I also can't reproduce this in the Sandbox.
Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response
Describe the Bug
Note that there was a similar issue a few months ago: #1624. However, that seems to be a slightly different case. The comments there might aid you in debugging this one though. I don't believe this is a duplicate (esp considering that one was fixed months ago).
Pyrefly version: 0.57.1 (latest as of time of writing)
Python version: 3.13.1
The below code:
incorrectly fails with
Interestingly, this only happens when I raise an exception AND don't specify a return type. Replacing the
raise NotImplementedErrorline with anything else (pass, docstring, actual code, ...) or adding a return type stops Pyrefly from complaining. I also can't reproduce this in the Sandbox.Sandbox Link
No response
(Only applicable for extension issues) IDE Information
No response