You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to use Self as return type of normal method #14649
Expected this to type check. We have been looking to use Self to remove all cases of the forward reference problem and avoid using from __future__ import annotations, which looks like it will be deprecated eventually.
It seems like Self should coalesce to the same type in this instance?
Actual Behavior
mypy --strict main.py
main.py:12: error: Incompatible return value type (got "Point", expected "Self") [return-value]
Found 1 error in 1 file (checked 1 source file)
Your Environment
Mypy version used: 1.0.0
Mypy command-line flags: --strict
Mypy configuration options from mypy.ini (and other config files): N/A
Activity
hauntsaninja commentedon Feb 8, 2023
Mypy is correct here, see #14635