New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do pass 1 semanatic analysis on the FuncDef of decorated functions #5654

Merged
merged 2 commits into from Sep 21, 2018

Conversation

Projects
None yet
2 participants
@msullivan
Collaborator

msullivan commented Sep 20, 2018

This populates fullname properly, fixing a crash where a decorated
function is used as a type annotation in an import cycle,
as well as fixing an obscure bug in sys.platform checks inside
decorated functions.

Fixes #5652.

Do pass 1 semanatic analysis on the FuncDef of decorated functions
This populates fullname properly, fixing a crash where a decorated
function is used as a type annotation in an import cycle,
as well as fixing an obscure bug in sys.platform checks inside
decorated functions.

Fixes #5652.

@msullivan msullivan requested review from JukkaL and ilevkivskyi Sep 20, 2018

@ilevkivskyi

Thanks for the quick fix! Only one suggestion.

@@ -147,14 +147,14 @@ def visit_assignment_stmt(self, s: AssignmentStmt) -> None:
for lval in s.lvalues:
self.analyze_lvalue(lval, explicit_type=s.type is not None)
def visit_func_def(self, func: FuncDef) -> None:
def visit_func_def(self, func: FuncDef, decorated: bool = False) -> None:

This comment has been minimized.

@ilevkivskyi

ilevkivskyi Sep 20, 2018

Collaborator

I would document the argument and the need for it, because it is not obvious.

@msullivan msullivan merged commit 1bc1047 into master Sep 21, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@msullivan msullivan deleted the semanal1-decorator branch Sep 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment