Skip to content

Deprecation fix #95

@ChrisRackauckas

Description

@ChrisRackauckas

Chris Rackauckas
Sep 7th at 7:48 PM
(construct(::Type{T}, nodes::Tuple{Vararg{<:AbstractMultiScaleArray}}, args...)
where {T <: AbstractMultiScaleArray}) = __construct(T, nodes, eltype(T)[], args...)

(construct(::Type{T}, nodes::Tuple{Vararg{<:AbstractMultiScaleArray}}, values, args...)
where {T <: AbstractMultiScaleArray}) = __construct(T, nodes, values, args...)
gives:
ERROR: LoadError: Wrapping Vararg directly in UnionAll is deprecated (wrap the tuple instead).
You may need to write f(x::Vararg{T}) rather than f(x::Vararg{<:T}) or f(x::Vararg{T}) where T instead of f(x::Vararg{T} where T).
Stacktrace:
How do I handle this case?
8 replies

Oscar Smith
Sep 7th at 7:55 PM
Vararg{AbstractMultiScaleArray}
7:57
julia> Tuple{Int} <: Tuple{Vararg{Integer}}
true

Chris Rackauckas
Sep 7th at 9:02 PM
ERROR: LoadError: ArgumentError: Vararg on non-final argument in method definition for construct at /home/runner/work/MultiScaleArrays.jl/MultiScaleArrays.jl/src/shape_construction.jl:53

Oscar Smith
Sep 7th at 9:06 PM
wait, this signature was ever valid?
9:07
how is it supposed to choose between nodes and args?
9:07
@jeffbezanson
look at this horribleness
Saved for later • Due 1 month ago

Jeff Bezanson
Sep 10th at 3:57 PM
The error message is unhelpful here since it's showing a random example rather than what you actually did. In this case you'd need nodes::Tuple{Vararg{T<:S}} where T, just put the where outside the tuple instead of only outside the vararg.

Chris Rackauckas
Today at 4:46 AM
@Oscar Smith
can you help unblock this? I don't quite understand this.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions