Skip to content

Commit 1c4faa5

Browse files
committed
Fix SimpleVarInfo method ambiguity
1 parent 6824229 commit 1c4faa5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/simple_varinfo.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,14 @@ function SimpleVarInfo(; kwargs...)
232232
end
233233

234234
# Constructor from `Model`.
235-
SimpleVarInfo(model::Model, args...) = SimpleVarInfo{Float64}(model, args...)
236-
function SimpleVarInfo{T}(model::Model, args...) where {T<:Real}
235+
function SimpleVarInfo(
236+
model::Model, args::Union{AbstractVarInfo,AbstractSampler,AbstractContext}...
237+
)
238+
return SimpleVarInfo{Float64}(model, args...)
239+
end
240+
function SimpleVarInfo{T}(
241+
model::Model, args::Union{AbstractVarInfo,AbstractSampler,AbstractContext}...
242+
) where {T<:Real}
237243
return last(evaluate!!(model, SimpleVarInfo{T}(), args...))
238244
end
239245

0 commit comments

Comments
 (0)