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 1
1
name = " DynamicPPL"
2
2
uuid = " 366bfd00-2699-11ea-058f-f148b4cae6d8"
3
- version = " 0.9.6 "
3
+ version = " 0.9.7 "
4
4
5
5
[deps ]
6
6
AbstractMCMC = " 80f14c24-f653-4e6a-9b94-39d6b0f70001"
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function model(expr, warn)
70
70
71
71
# Generate main body
72
72
modelinfo[:body ] = generate_mainbody (
73
- modelinfo[:modeldef ][:body ], modelinfo[:allargs_exprs ], warn
73
+ modelinfo[:modeldef ][:body ], modelinfo[:allargs_syms ], warn
74
74
)
75
75
76
76
return build_output (modelinfo)
@@ -117,7 +117,7 @@ function build_model_info(input_expr)
117
117
allargs_exprs = first .(allargs_exprs_defaults)
118
118
119
119
# Extract the names of the arguments.
120
- allargs_syms = map (allargs_exprs_defaults ) do ( arg, _)
120
+ allargs_syms = map (allargs_exprs ) do arg
121
121
MacroTools. @match arg begin
122
122
(:: Type{T_} ) | (name_:: Type{T_} ) => T
123
123
name_:: T_ => name
Original file line number Diff line number Diff line change 635
635
m = demo (0. )
636
636
@test m () isa Float64
637
637
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
638
649
end
You can’t perform that action at this time.
0 commit comments