Bug Report
Mypy cannot determine the type of the declared field inside a protocol method.
To Reproduce
Invoke mypy on the following Python file
# bug.py
from typing import Protocol
class Test(Protocol):
k: int
def test(self, i: int):
self.k = self.k
Mypy complains: bug.py:7: error: Cannot determine type of "k". Strange here is if I remove the parameter i, the error would disappear.
Expected Behavior
No such error.
My Environment
Bug Report
Mypy cannot determine the type of the declared field inside a protocol method.
To Reproduce
Invoke mypy on the following Python file
Mypy complains:
bug.py:7: error: Cannot determine type of "k". Strange here is if I remove the parameteri, the error would disappear.Expected Behavior
No such error.
My Environment
mypy.ini(and other config files): None