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

difficult to parse error #99

Open
aviks opened this issue Jul 26, 2023 · 0 comments
Open

difficult to parse error #99

aviks opened this issue Jul 26, 2023 · 0 comments

Comments

@aviks
Copy link

aviks commented Jul 26, 2023

If I pass in an Any[] array to SampleBuf, even if it contains all floats, it throws an error that does not mean much to me. This error goes away if the array is typed as Float64[]

s =  SampleBuf(x, 44100.)
44100-frame, 1-channel SampleBuf{Any, 1}
1.0s sampled at 44100.0HzError showing value of type SampleBuf{Any, 1}:
ERROR: MethodError: no method matching find_buf(::Base.Broadcast.Extruded{SampleBuf{Any, 2}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}, ::Tuple{})
Closest candidates are:
  find_buf(::SampleBuf, ::Any) at C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:97 
  find_buf(::SpectrumBuf, ::Any) at C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:97
  find_buf(::Any) at C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:86
  ...
Stacktrace:
  [1] find_buf(args::Tuple{Base.Broadcast.Extruded{SampleBuf{Any, 2}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}})
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:85
  [2] find_buf(bc::Base.Broadcast.Broadcasted{Base.Broadcast.ArrayStyle{SampleBuf{Any, 2}}, Nothing, typeof(float), Tuple{Base.Broadcast.Extruded{SampleBuf{Any, 2}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}})   
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:94
  [3] find_buf(args::Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.ArrayStyle{SampleBuf{Any, 2}}, Nothing, typeof(float), Tuple{Base.Broadcast.Extruded{SampleBuf{Any, 2}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}})
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:85
  [4] find_buf(bc::Base.Broadcast.Broadcasted{Base.Broadcast.ArrayStyle{SampleBuf{Any, 2}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, typeof(abs), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.ArrayStyle{SampleBuf{Any, 2}}, Nothing, typeof(float), Tuple{Base.Broadcast.Extruded{SampleBuf{Any, 2}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}}})
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:94
  [5] similar(bc::Base.Broadcast.Broadcasted{Base.Broadcast.ArrayStyle{SampleBuf{Any, 2}}, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, typeof(abs), Tuple{Base.Broadcast.Broadcasted{Base.Broadcast.ArrayStyle{SampleBuf{Any, 2}}, Nothing, typeof(float), Tuple{Base.Broadcast.Extruded{SampleBuf{Any, 2}, Tuple{Bool, Bool}, Tuple{Int64, Int64}}}}}}, #unused#::Type{Float64})
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:101
  [6] copy
    @ .\broadcast.jl:900 [inlined]
  [7] materialize
    @ .\broadcast.jl:860 [inlined]
  [8] showchannels(io::IOContext{Base.TTY}, buf::SampleBuf{Any, 1}, widthchars::Int64)
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:188
  [9] showchannels
    @ C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:182 [inlined]
 [10] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, buf::SampleBuf{Any, 1})        
    @ SampledSignals C:\Users\avik\.julia\packages\SampledSignals\kxDrC\src\SampleBuf.jl:177
 [11] (::REPL.var"#43#44"{REPL.REPLDisplay{REPL.LineEditREPL}, MIME{Symbol("text/plain")}, Base.RefValue{Any}})(io::Any)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:267
 [12] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:521
 [13] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:260
 [14] display(d::REPL.REPLDisplay, x::Any)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:272
 [15] display(x::Any)
    @ Base.Multimedia .\multimedia.jl:328
 [16] #invokelatest#2
    @ .\essentials.jl:729 [inlined]
 [17] invokelatest
    @ .\essentials.jl:726 [inlined]
 [18] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:296
 [19] (::REPL.var"#45#46"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:278
 [20] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:521
 [21] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:276
 [22] (::REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:857
 [23] (::VSCodeServer.var"#98#101"{REPL.var"#do_respond#66"{Bool, Bool, REPL.var"#77#87"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt}})(mi::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ VSCodeServer c:\Users\avik\.vscode\extensions\julialang.language-julia-1.47.2\scripts\packages\VSCodeServer\src\repl.jl:122
 [24] #invokelatest#2
    @ .\essentials.jl:729 [inlined]
 [25] invokelatest
    @ .\essentials.jl:726 [inlined]
 [26] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\LineEdit.jl:2510
 [27] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\Users\avik\.julia\juliaup\julia-1.8.5+0.x64.w64.mingw32\share\julia\stdlib\v1.8\REPL\src\REPL.jl:1248
 [28] (::REPL.var"#49#54"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL .\task.jl:484
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

No branches or pull requests

1 participant