Skip to content

Commit 2f74d66

Browse files
committed
Merge branch 'master' into context_independence
2 parents 136c101 + c59f519 commit 2f74d66

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DynamicPPL"
22
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
33
authors = ["mohamed82008 <[email protected]>"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[deps]
77
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
@@ -11,7 +11,7 @@ MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1111

1212
[compat]
1313
AbstractMCMC = "0.4, 0.5"
14-
Bijectors = "0.5.2"
14+
Bijectors = "0.5.2, 0.6"
1515
Distributions = "0.22"
1616
MacroTools = "0.5.1"
1717
julia = "1"

src/compiler.jl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,8 @@ function build_output(model_info)
479479
end
480480
end)
481481
end
482-
return esc(quote
483-
# Allows passing arguments as kwargs
484-
$outer_function(;$(args...)) = $outer_function($(arg_syms...))
482+
483+
ex = quote
485484
function $outer_function($(args...))
486485
function $inner_function(
487486
$vi::DynamicPPL.VarInfo,
@@ -496,7 +495,17 @@ function build_output(model_info)
496495
return DynamicPPL.Model($inner_function, $args_nt, $model_gen_constructor)
497496
end
498497
$model_gen = $model_gen_constructor
499-
end)
498+
end
499+
500+
if !isempty(args)
501+
ex = quote
502+
$ex
503+
# Allows passing arguments as kwargs
504+
$outer_function(;$(args...)) = $outer_function($(arg_syms...))
505+
end
506+
end
507+
508+
return esc(ex)
500509
end
501510

502511
# A hack for NamedTuple type specialization

0 commit comments

Comments
 (0)