Skip to content
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ true
@inline unit(x::Type{Missing}) = missing
@inline unit(x::Missing) = missing

"""
unit(::Type{Any})

This method is here to prevent infinite recursion and to provide a helpful error message in case it occurs.
"""
@inline unit(x::Type{Any}) = throw( ArgumentError(
"""
The method unit(Any) was called, but this method has no meaningful result.
The call may be due to calling unit(eltype(…)) on a container,
since eltype has a generic fallback method that returns Any.
"""
) )

"""
absoluteunit(::Units)
absoluteunit(::Quantity)
Expand Down
Loading