Skip to content

Commit db141d5

Browse files
committed
Add named tuple splatting
1 parent dc5914e commit db141d5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/query_translation.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ end
1414
function helper_namedtuples_replacement(ex)
1515
return postwalk(ex) do x
1616
if x isa Expr && x.head==:braces
17-
new_ex = Expr(:tuple, x.args...)
17+
new_ex = Expr(:tuple, Expr(:parameters, x.args...))
1818

19-
for (j,field_in_NT) in enumerate(new_ex.args)
19+
for (j,field_in_NT) in enumerate(new_ex.args[1].args)
2020
if isa(field_in_NT, Expr) && field_in_NT.head==:.
2121
name_to_use = field_in_NT.args[2].value
22-
new_ex.args[j] = Expr(:(=), name_to_use, field_in_NT)
22+
new_ex.args[1].args[j] = Expr(:(=), name_to_use, field_in_NT)
2323
elseif isa(field_in_NT, Symbol)
24-
new_ex.args[j] = Expr(:(=), field_in_NT, field_in_NT)
24+
new_ex.args[1].args[j] = Expr(:(=), field_in_NT, field_in_NT)
2525
end
2626
end
2727

0 commit comments

Comments
 (0)