Repository navigation
Push correct enclosing class while deferring a method - #4073
Conversation
|
I think I am to blame for the name Can't the issue be resolved by freezing the entire scope, as suggested by the Anyway, if you are leaving the method |
It is unnecessary, and will only make solution more complex.
OK, I renamed this variable, I keep however the named tuple attribute name, |
|
Can you fix the merge conflict? |
Fixed. |
|
This generates unexpected errors when run against an internal Dropbox codebase. Here is a simplified example: class A:
def f(self) -> None:
def g(x: int) -> int: # Self argument missing for a non-static method
# (or an invalid type for self)
return y
y = int() |
Indeed, since the |
|
@JukkaL Fixed. |
JukkaL
left a comment
There was a problem hiding this comment.
LGTM, thanks for the PR!
Fixes #4069
This pushes the correct enclosing class while deferring a method instead of just the top class.
A related comment: the name
active_classis a bit misleading, it returnsNonefrom within methods, I think it would be more consistent ifactive_classbehave the same way asself.typein semantic analysis, but it is too late to change this, it is already used in several other places with this semantics.