Skip to content

Commit 63e4bef

Browse files
authored
Merge pull request #61 from Krastanov/master
Additional kwarg fixes.
2 parents 522a634 + e2a651f commit 63e4bef

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Polyester"
22
uuid = "f517fe37-dbe3-4b94-8317-1923a5111588"
33
authors = ["Chris Elrod <elrodc@gmail.com> and contributors"]
4-
version = "0.6.1"
4+
version = "0.6.2"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/closure.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ function extractargs!(arguments::Vector{Symbol}, defined::Dict{Symbol,Symbol}, e
106106
end
107107
end
108108
elseif head === :kw
109-
args[2] = getgensym!(defined, args[2])
109+
if args[2] isa Symbol
110+
args[2] = get_sym!(defined, arguments, args[2], mod)
111+
else
112+
extractargs!(arguments, defined, args[2], mod)
113+
end
110114
return
111115
end
112116
for i startind:length(args)

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ end
353353
buf[i] = f(; kw=i)
354354
end
355355
@test buf==[1,2]
356+
# issue 61
357+
function ff(buf,a)
358+
@batch for i in 1:2
359+
buf[i] = f(kw=i+a)
360+
end
361+
end
362+
ff(buf,2)
363+
@test buf==[3,4]
356364
end
357365

358366
if VERSION v"1.6"

0 commit comments

Comments
 (0)