Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ArrayInterfaceCore.lu_instance
ArrayInterfaceCore.matrix_colors
ArrayInterfaceCore.issingular
ArrayInterfaceCore.parent_type
ArrayInterfaceCore.promote_eltype
ArrayInterfaceCore.restructure
ArrayInterfaceCore.safevec
ArrayInterfaceCore.zeromatrix
Expand Down
2 changes: 1 addition & 1 deletion lib/ArrayInterfaceCore/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ArrayInterfaceCore"
uuid = "30b0a656-2188-435a-8636-2ec0e6a096e2"
version = "0.1.18"
version = "0.1.19"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
11 changes: 11 additions & 0 deletions lib/ArrayInterfaceCore/src/ArrayInterfaceCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ parent_type(@nospecialize T::Type{<:Union{Base.Slice,Base.IdentityUnitRange}}) =
parent_type(::Type{Diagonal{T,V}}) where {T,V} = V
parent_type(T::Type) = T

"""
promote_eltype(::Type{<:AbstractArray{T,N}}, ::Type{T2})

Computes the type of the `AbstractArray` that results from the element
type changing to `promote_type(T,T2)`.

Note that no generic fallback is given.
"""
function promote_eltype end
promote_eltype(::Type{Array{T,N}}, ::Type{T2}) where {T,T2,N} = Array{promote_type(T,T2),N}

"""
buffer(x)

Expand Down