File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 11name = " DynamicPPL"
22uuid = " 366bfd00-2699-11ea-058f-f148b4cae6d8"
3- version = " 0.9.6 "
3+ version = " 0.9.7 "
44
55[deps ]
66AbstractMCMC = " 80f14c24-f653-4e6a-9b94-39d6b0f70001"
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function model(expr, warn)
7070
7171 # Generate main body
7272 modelinfo[:body ] = generate_mainbody (
73- modelinfo[:modeldef ][:body ], modelinfo[:allargs_exprs ], warn
73+ modelinfo[:modeldef ][:body ], modelinfo[:allargs_syms ], warn
7474 )
7575
7676 return build_output (modelinfo)
@@ -117,7 +117,7 @@ function build_model_info(input_expr)
117117 allargs_exprs = first .(allargs_exprs_defaults)
118118
119119 # Extract the names of the arguments.
120- allargs_syms = map (allargs_exprs_defaults ) do ( arg, _)
120+ allargs_syms = map (allargs_exprs ) do arg
121121 MacroTools. @match arg begin
122122 (:: Type{T_} ) | (name_:: Type{T_} ) => T
123123 name_:: T_ => name
Original file line number Diff line number Diff line change 635635 m = demo (0. )
636636 @test m () isa Float64
637637 end
638+ @testset " type annotations" begin
639+ @model function demo_without (x)
640+ x ~ Normal ()
641+ end
642+ @test isempty (VarInfo (demo_without (0.0 )))
643+
644+ @model function demo_with (x:: Real )
645+ x ~ Normal ()
646+ end
647+ @test isempty (VarInfo (demo_with (0.0 )))
648+ end
638649end
You can’t perform that action at this time.
0 commit comments