-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I don't think you're allowed to do this:
GTPSA.jl/src/fastgtpsa/temptps.jl
Lines 132 to 138 in 29e2f83
| # NOTE: for some reason, merely overloading this function causes allocations | |
| # in Julia 1.9. This is not the case in 1.10, so presumably this is a bug. | |
| # Therefore, allocation tests only are performed on >=1.10 | |
| function Base.setindex!(A::Array{T}, x::TempTPS, i1::Int) where {T<:TPS} | |
| copy!(A[i1], x) | |
| rel_temp!(x) | |
| end |
I think this only works "by accident", e.g., I suppose it could break with any Julia release, if Base decides to change its implementation regarding setindex! for Array.
It seems like type piracy, in some sense. Or perhaps it's function punning that might be confusing to users? Not sure TBH, but it definitely feels very bad.
There's another potential issue with the method signature, though an easily fixable one: it matches setindex!(::Array{Union{}}, ::TempTPS, ::Int), which is surely not intended. Fix: #136
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels