Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrectly typed method for _vec_mul_arguments #350

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

DanielVandH
Copy link
Contributor

@DanielVandH DanielVandH commented Nov 19, 2024

I noticed that this method is implicitly assuming that the argument is a ::Tuple{Any} but it will actually accept any argument, i.e. the method is _vec_mul_arguments(::Any, ::Any) when it should be _vec_mul_arguments(::Any, ::Tuple{Any}). For example, on master,

julia> LazyArrays._vec_mul_arguments(2, [])
ERROR: BoundsError: attempt to access 0-element Vector{Any} at index [1]
Stacktrace:
 [1] throw_boundserror(A::Vector{Any}, I::Tuple{Int64})
   @ Base .\essentials.jl:14
 [2] getindex
   @ .\essentials.jl:916 [inlined]
 [3] indexed_iterate (repeats 2 times)
   @ .\tuple.jl:160 [inlined]
 [4] _vec_mul_arguments(args::Int64, ::Vector{Any})
   @ LazyArrays C:\Users\djv23\.julia\packages\LazyArrays\zl2b5\src\linalg\mul.jl:240
 [5] top-level scope
   @ REPL[29]:1

I don't have the best test since the bug I encountered with this is buried in some other code (@dlfivefifty it came up when using CircleCoordinate which failed to match the correct method on Line 252 since CircleCoordinate wasn't a number and so it went to this most generic method).

Hopefully nothing downstream is relying on this behaviour somehow

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.65%. Comparing base (bd92dfc) to head (998f942).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #350   +/-   ##
=======================================
  Coverage   95.65%   95.65%           
=======================================
  Files          17       17           
  Lines        3155     3155           
=======================================
  Hits         3018     3018           
  Misses        137      137           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dlfivefifty dlfivefifty merged commit 600d257 into JuliaArrays:master Nov 27, 2024
16 checks passed
@dlfivefifty
Copy link
Member

Actually seems like a Julia bug ...but thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants