Skip to content

Commit c7dbfea

Browse files
committed
nospecializeinfer instead of inference barrier
1 parent ee93d86 commit c7dbfea

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/component_functions.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ Optional Arguments:
299299
300300
All Symbol arguments can be used to set default values, i.e. `psym=[:K=>1, :p]`.
301301
"""
302-
VertexModel(; kwargs...) = _construct_comp(VertexModel, Base.inferencebarrier(kwargs))
303-
VertexModel(v::VertexModel; kwargs...) = _reconstruct_comp(VertexModel, v, Base.inferencebarrier(kwargs))
302+
VertexModel(; kwargs...) = _construct_comp(VertexModel, kwargs)
303+
VertexModel(v::VertexModel; kwargs...) = _reconstruct_comp(VertexModel, v, kwargs)
304304

305305
struct EdgeModel <: ComponentModel
306306
name::Symbol
@@ -357,8 +357,8 @@ Optional Arguments:
357357
358358
All Symbol arguments can be used to set default values, i.e. `psym=[:K=>1, :p]`.
359359
"""
360-
EdgeModel(; kwargs...) = _construct_comp(EdgeModel, Base.inferencebarrier(kwargs))
361-
EdgeModel(v::EdgeModel; kwargs...) = _reconstruct_comp(EdgeModel, v, Base.inferencebarrier(kwargs))
360+
EdgeModel(; kwargs...) = _construct_comp(EdgeModel, kwargs)
361+
EdgeModel(v::EdgeModel; kwargs...) = _reconstruct_comp(EdgeModel, v, kwargs)
362362

363363
"""
364364
compf(c::ComponentModel)
@@ -598,8 +598,8 @@ end
598598
Internal function to construct a component model from keyword arguments.
599599
Fills up kw arguments with default values and performs sanity checks.
600600
"""
601-
function _construct_comp(::Type{T}, @nospecialize(kwargs)) where {T}
602-
dict = _fill_defaults(T, Base.inferencebarrier(kwargs))
601+
Base.@nospecializeinfer function _construct_comp(::Type{T}, @nospecialize(kwargs)) where {T}
602+
dict = _fill_defaults(T, kwargs)
603603

604604
# check signature of f
605605
# if !_valid_signature(T, dict[:f])
@@ -625,7 +625,7 @@ function _construct_comp(::Type{T}, @nospecialize(kwargs)) where {T}
625625
return c
626626
end
627627

628-
function _reconstruct_comp(::Type{T}, cf::ComponentModel, kwargs) where {T}
628+
Base.@nospecializeinfer function _reconstruct_comp(::Type{T}, cf::ComponentModel, @nospecialize(kwargs)) where {T}
629629
fields = fieldnames(T)
630630
dict = Dict{Symbol, Any}()
631631
for f in fields
@@ -643,7 +643,7 @@ end
643643
Fill up keyword arguments `kwargs` for type T with default values.
644644
Also perfoms sanity check some properties like mass matrix, depth, ...
645645
"""
646-
function _fill_defaults(T, @nospecialize(kwargs))
646+
Base.@nospecializeinfer function _fill_defaults(T, @nospecialize(kwargs))
647647
dict = Dict{Symbol, Any}(kwargs)
648648
allow_output_sym_clash = pop!(dict, :allow_output_sym_clash, false)
649649

0 commit comments

Comments
 (0)