Skip to content

Commit 765ca33

Browse files
mofeingwsmosesgithub-actions[bot]
authored
Fix create_result for AbstractDict (#1331)
* Fix `create_result` for `AbstractDict` * fix * Format code Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: William S. Moses <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a25cef4 commit 765ca33

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Compiler.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,17 +623,27 @@ function create_result(
623623
)
624624

625625
if !haskey(result_cache, tocopy)
626-
ar = create_result(pairs(tocopy), path, args...)
627626
sym = Symbol("result", var_idx[])
628627
var_idx[] += 1
629628

630629
push!(
631630
resultgen_code,
632631
quote
633-
$sym = $D($ar)
632+
$sym = $D()
634633
end,
635634
)
635+
636636
result_cache[tocopy] = sym
637+
638+
for (k, v) in pairs(tocopy)
639+
subexpr = create_result(v, append_path(path, k), args...)
640+
push!(
641+
resultgen_code,
642+
quote
643+
@inbounds $sym[$k] = $subexpr
644+
end,
645+
)
646+
end
637647
end
638648

639649
return quote

0 commit comments

Comments
 (0)