Skip to content

Commit

Permalink
Fix minor class constructor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelMarcelino committed Oct 8, 2022
1 parent bf101fc commit 4b107aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyjl/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,8 @@ def visit_init(self, node: ast.FunctionDef):
struct_name = get_id(class_node)
has_default = node.args.defaults != []
if constructor_body or has_default:
new_args = [ast.arg(arg=key) for key in class_node.declarations.keys()]
decls = list(map(lambda x: ast.Name(id=x.arg), node.args.args+new_args))
# new_args = [ast.arg(arg=key) for key in class_node.declarations.keys()]
decls = list(map(lambda x: ast.Name(id=x.arg), node.args.args))
new_instance = ast.Call(
func=ast.Name(id="new"), args=decls, keywords=[], scopes=ScopeList()
)
Expand Down

0 comments on commit 4b107aa

Please sign in to comment.