File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -588,9 +588,8 @@ function build_output(model_info)
588
588
end
589
589
end )
590
590
end
591
- return esc (quote
592
- # Allows passing arguments as kwargs
593
- $ outer_function (;$ (args... )) = $ outer_function ($ (arg_syms... ))
591
+
592
+ ex = quote
594
593
function $outer_function ($ (args... ))
595
594
function $inner_function (
596
595
$ vi:: DynamicPPL.VarInfo ,
@@ -605,7 +604,17 @@ function build_output(model_info)
605
604
return DynamicPPL. Model ($ inner_function, $ args_nt, $ model_gen_constructor)
606
605
end
607
606
$ model_gen = $ model_gen_constructor
608
- end )
607
+ end
608
+
609
+ if ! isempty (args)
610
+ ex = quote
611
+ $ ex
612
+ # Allows passing arguments as kwargs
613
+ $ outer_function (;$ (args... )) = $ outer_function ($ (arg_syms... ))
614
+ end
615
+ end
616
+
617
+ return esc (ex)
609
618
end
610
619
611
620
# A hack for NamedTuple type specialization
You can’t perform that action at this time.
0 commit comments