Skip to content

Commit 90eb55e

Browse files
authored
Merge branch 'master' into fixes_threaded
2 parents 16fd886 + 0758d01 commit 90eb55e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/compiler.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function build_output(model_info)
352352
$generator($(args...)) = $(DynamicPPL.Model)($evaluator, $args_nt, $model_gen_constructor)
353353
$(generator_kw_form...)
354354

355-
$model_gen = $model_gen_constructor
355+
$(Base).@__doc__ $model_gen = $model_gen_constructor
356356
end
357357
end
358358

test/compiler.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,4 +580,18 @@ end
580580
model = demo()
581581
@test all(iszero(model()) for _ in 1:1000)
582582
end
583+
@testset "docstring" begin
584+
"This is a test"
585+
@model function demo(x)
586+
m ~ Normal()
587+
x ~ Normal(m, 1)
588+
end
589+
590+
s = @doc(demo)
591+
@test string(s) == "This is a test\n"
592+
593+
# Verify that adding docstring didn't completely break execution of model
594+
m = demo(0.)
595+
@test m() isa Float64
596+
end
583597
end

0 commit comments

Comments
 (0)