@@ -707,53 +707,3 @@ function warn_empty(body)
707
707
end
708
708
return nothing
709
709
end
710
-
711
- # TODO (mhauru) matchingvalue has methods that can accept both types and values. Why?
712
- # TODO (mhauru) This function needs a more comprehensive docstring.
713
- """
714
- matchingvalue(vi, value)
715
-
716
- Convert the `value` to the correct type for the `vi` object.
717
- """
718
- function matchingvalue (vi, value)
719
- T = typeof (value)
720
- if hasmissing (T)
721
- _value = convert (get_matching_type (vi, T), value)
722
- # TODO (mhauru) Why do we make a deepcopy, even though in the !hasmissing branch we
723
- # are happy to return `value` as-is?
724
- if _value === value
725
- return deepcopy (_value)
726
- else
727
- return _value
728
- end
729
- else
730
- return value
731
- end
732
- end
733
-
734
- function matchingvalue (vi, value:: FloatOrArrayType )
735
- return get_matching_type (vi, value)
736
- end
737
- function matchingvalue (vi, :: TypeWrap{T} ) where {T}
738
- return TypeWrap {get_matching_type(vi, T)} ()
739
- end
740
-
741
- # TODO (mhauru) This function needs a more comprehensive docstring. What is it for?
742
- """
743
- get_matching_type(vi, ::TypeWrap{T}) where {T}
744
-
745
- Get the specialized version of type `T` for `vi`.
746
- """
747
- get_matching_type (_, :: Type{T} ) where {T} = T
748
- function get_matching_type (vi, :: Type{<:Union{Missing,AbstractFloat}} )
749
- return Union{Missing,float_type_with_fallback (eltype (vi))}
750
- end
751
- function get_matching_type (vi, :: Type{<:AbstractFloat} )
752
- return float_type_with_fallback (eltype (vi))
753
- end
754
- function get_matching_type (vi, :: Type{<:Array{T,N}} ) where {T,N}
755
- return Array{get_matching_type (vi, T),N}
756
- end
757
- function get_matching_type (vi, :: Type{<:Array{T}} ) where {T}
758
- return Array{get_matching_type (vi, T)}
759
- end
0 commit comments