Skip to content

Commit

Permalink
Fix unintentional method shadowing in ASTAnnotatedVar
Browse files Browse the repository at this point in the history
  • Loading branch information
zrax committed Dec 2, 2022
1 parent e623e9a commit 305494c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ASTNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ class ASTAnnotatedVar : public ASTNode {
: ASTNode(NODE_ANNOTATED_VAR), m_name(std::move(name)), m_type(std::move(type)) { }

PycRef<ASTNode> name() const noexcept { return m_name; }
PycRef<ASTNode> type() const noexcept { return m_type; }
PycRef<ASTNode> annotation() const noexcept { return m_type; }

private:
PycRef<ASTNode> m_name;
Expand Down
4 changes: 2 additions & 2 deletions ASTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3305,11 +3305,11 @@ void print_src(PycRef<ASTNode> node, PycModule* mod)
{
PycRef<ASTAnnotatedVar> annotated_var = node.cast<ASTAnnotatedVar>();
PycRef<ASTObject> name = annotated_var->name().cast<ASTObject>();
PycRef<ASTNode> type = annotated_var->type();
PycRef<ASTNode> annotation = annotated_var->annotation();

fputs(name->object().cast<PycString>()->value(), pyc_output);
fputs(": ", pyc_output);
print_src(type, mod);
print_src(annotation, mod);
}
break;
case ASTNode::NODE_TERNARY:
Expand Down

0 comments on commit 305494c

Please sign in to comment.