Skip to content

Commit a563487

Browse files
authored
Issue 403c (#419)
* avoid invalidation; warning with v1.8 * push off warning removal for another day
1 parent d1782dc commit a563487

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/common.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ end
897897

898898
return quote
899899
Base.@_inline_meta
900+
#Base.@inline
900901
tuple($(exprs...))
901902
end
902903

src/polynomials/ImmutablePolynomial.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ LinearAlgebra.norm(q::ImmutablePolynomial, p::Real) = _norm(q.coeffs, p)
240240
end
241241

242242
return quote
243-
$(Expr(:meta, :inline))
243+
$(Expr(:meta, :inline)) # 1.8 deprecation
244+
#Base.@inline
244245
@inbounds return sqrt($expr)
245246
end
246247

@@ -259,7 +260,8 @@ _norm_p0(x) = iszero(x) ? zero(x) : one(x)
259260
end
260261

261262
return quote
262-
$(Expr(:meta, :inline))
263+
$(Expr(:meta, :inline)) # 1.8 deprecation
264+
#Base.@inline
263265
if p == Inf
264266
return mapreduce(abs, max, a)
265267
elseif p == 1

src/polynomials/pi_n_polynomial.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ Polynomials.@register PnPolynomial
2828
# change broadcast semantics
2929
Base.broadcastable(p::PnPolynomial) = p.coeffs;
3030
Base.ndims(::Type{<:PnPolynomial}) = 1
31-
Base.copyto!(p::PnPolynomial, x) = copyto!(p.coeffs, x);
31+
Base.copyto!(p::PnPolynomial{T, X}, x::S) where
32+
{T, X,
33+
S<:Union{AbstractVector, Base.AbstractBroadcasted, Tuple} # to avoid an invalidation. Might need to be more general?
34+
} = copyto!(p.coeffs, x)
3235

3336
function Polynomials.degree(p::PnPolynomial)
3437
i = findlast(!iszero, p.coeffs)
@@ -43,9 +46,8 @@ function LinearAlgebra.mul!(pq, p::PnPolynomial{T,X}, q) where {T,X}
4346
for i 0:m
4447
for j 0:n
4548
k = i + j
46-
pq.coeffs[1+k] += p.coeffs[1+i] * q.coeffs[1+j]
49+
@inbounds pq.coeffs[1+k] += p.coeffs[1+i] * q.coeffs[1+j]
4750
end
4851
end
4952
nothing
5053
end
51-

src/polynomials/standard-basis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ end
125125
end
126126

127127
return quote
128-
Base.@_inline_meta
128+
Base.@_inline_meta # 1.8 deprecation
129129
tuple($(exprs...))
130130
end
131131

0 commit comments

Comments
 (0)