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

add friendly error message for multiple return syntax #133

Closed
HomerReid opened this issue Jul 18, 2011 · 5 comments
Closed

add friendly error message for multiple return syntax #133

HomerReid opened this issue Jul 18, 2011 · 5 comments
Assignees

Comments

@HomerReid
Copy link
Contributor

  julia> [V, D] = eig([1.0 2.0; 2.0 1.0]) 
  syntax error: invalid assignment lvalue (call (top vcat) V D)
  in run_repl, /home/homer/hacking/julia/j/client.j:23
  in _start, /home/homer/hacking/julia/j/client.j:153

Instead, detect what they're trying to do and show a nice friendly message.

@ViralBShah
Copy link
Member

I think this should be two separate issues. Promotion of integer arrays to float is generally required for all linear algebra operations, and needs a general way to handle.

@ghost ghost assigned JeffBezanson Jul 19, 2011
@StefanKarpinski
Copy link
Member

Promotion of arguments to LAPACK functions should be pretty easy since they're all generated with macros anyway. See issue #134.

@ViralBShah
Copy link
Member

But, we'd have to change each BLAS/LAPACK/ARPACK macro and such. Isn't there a simpler way?

-viral

On Jul 19, 2011, at 8:47 AM, StefanKarpinski wrote:

Promotion of arguments to LAPACK functions should be pretty easy since they're all generated with macros anyway. See issue #134.

Reply to this email directly or view it on GitHub:
#133 (comment)

@StefanKarpinski
Copy link
Member

I'm not sure where you're seeing difficulty here. We need to add things like this:

eig{T<:Real}(x::Array{T,2}) = eig(float64(x))

Assuming that float64 is appropriately vectorized (which I just made a commit (abfc98a) that helps with). Yes, we need to add one for each LAPACK function, but that's hardly a big deal. For BLAS, it's not appropriate because we actually want to use slower but exact integer arithmetic for those operations. eig is going to produce floating point regardless, so converting first is the right way to go. ARPACK has two functions in it and we don't really support them very well yet, so we can just punt for now.

@ViralBShah
Copy link
Member

Ok, I guess that's easy enough.

JeffBezanson added a commit that referenced this issue Jul 19, 2011
StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
eliminate a couple of deprecation warnings
KristofferC pushed a commit to KristofferC/julia that referenced this issue Feb 18, 2018
do not resolve standard libraries, these are automatically satisfied
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
aviatesk added a commit that referenced this issue Oct 21, 2021
JET reported:
```julia
julia> report_package(JET)
...
[toplevel-info] analyzing from top-level definitions ... 671/671
═════ 12 possible errors found ═════
...
┌ @ avi-/JET/src/JET.jl:990 #self#(text, "top-level")
│┌ @ avi-/JET/src/JET.jl:990 JET.#report_text#124(JET.JETAnalyzer, JET.nothing, Base.pairs(Core.NamedTuple()), #self#, text, filename)
││┌ @ avi-/JET/src/JET.jl:993 res = JET.virtual_process(text, filename, analyzer′, config)
│││┌ @ avi-/JET/src/toplevel/virtualprocess.jl:301 res = JET._virtual_process!(x, filename, analyzer, config, context, JET.VirtualProcessResult(actual2virtual, context))
││││┌ @ avi-/JET/src/toplevel/virtualprocess.jl:432 res = JET._virtual_process!(toplevelex, filename, analyzer, config, context, res)
│││││┌ @ avi-/JET/src/toplevel/virtualprocess.jl:637 JET.analyze_toplevel!(analyzer, src)
││││││┌ @ avi-/JET/src/JET.jl:1142 JET.#analyze_toplevel!#133(true, #self#, analyzer, src)
│││││││┌ @ avi-/JET/src/JET.jl:1160 JET.analyze_frame!(analyzer, frame)
││││││││┌ @ avi-/JET/src/JET.jl:747 JET.typeinf(analyzer, frame)
│││││││││┌ @ compiler/abstractinterpretation.jl:1243 Core.Compiler.lastindex(fargs)
││││││││││ for 1 of union split cases, no matching method found for call signatures (Tuple{typeof(Core.Compiler.lastindex), Nothing})): Core.Compiler.lastindex(fargs::Union{Nothing, Vector{Any}})
│││││││││└───────────────────────────────────────────
│││││││││┌ @ compiler/abstractinterpretation.jl:1243 fargs′ = Core.Compiler.getindex(fargs, Core.Compiler.:(3, Core.Compiler.lastindex(fargs)))
││││││││││ for 1 of union split cases, no matching method found for call signatures (Tuple{typeof(Core.Compiler.getindex), Nothing, Core.Compiler.UnitRange{Int64}})): fargs′ = Core.Compiler.getindex(fargs::Union{Nothing, Vector{Any}}, Core.Compiler.:(3, Core.Compiler.lastindex(fargs::Union{Nothing, Vector{Any}})::Int64)::Core.Compiler.UnitRange{Int64})
│││││││││└───────────────────────────────────────────
│││││││││┌ @ compiler/abstractinterpretation.jl:1244 Core.Compiler.getindex(fargs, 1)
││││││││││ for 1 of union split cases, no matching method found for call signatures (Tuple{typeof(Core.Compiler.getindex), Nothing, Int64})): Core.Compiler.getindex(fargs::Union{Nothing, Vector{Any}}, 1)
│││││││││└───────────────────────────────────────────
...
```
aviatesk added a commit that referenced this issue Oct 21, 2021
JET reported:
```julia
julia> report_package(JET)
...
[toplevel-info] analyzing from top-level definitions ... 671/671
═════ 12 possible errors found ═════
...
┌ @ avi-/JET/src/JET.jl:990 #self#(text, "top-level")
│┌ @ avi-/JET/src/JET.jl:990 JET.#report_text#124(JET.JETAnalyzer, JET.nothing, Base.pairs(Core.NamedTuple()), #self#, text, filename)
││┌ @ avi-/JET/src/JET.jl:993 res = JET.virtual_process(text, filename, analyzer′, config)
│││┌ @ avi-/JET/src/toplevel/virtualprocess.jl:301 res = JET._virtual_process!(x, filename, analyzer, config, context, JET.VirtualProcessResult(actual2virtual, context))
││││┌ @ avi-/JET/src/toplevel/virtualprocess.jl:432 res = JET._virtual_process!(toplevelex, filename, analyzer, config, context, res)
│││││┌ @ avi-/JET/src/toplevel/virtualprocess.jl:637 JET.analyze_toplevel!(analyzer, src)
││││││┌ @ avi-/JET/src/JET.jl:1142 JET.#analyze_toplevel!#133(true, #self#, analyzer, src)
│││││││┌ @ avi-/JET/src/JET.jl:1160 JET.analyze_frame!(analyzer, frame)
││││││││┌ @ avi-/JET/src/JET.jl:747 JET.typeinf(analyzer, frame)
│││││││││┌ @ compiler/abstractinterpretation.jl:1243 Core.Compiler.lastindex(fargs)
││││││││││ for 1 of union split cases, no matching method found for call signatures (Tuple{typeof(Core.Compiler.lastindex), Nothing})): Core.Compiler.lastindex(fargs::Union{Nothing, Vector{Any}})
│││││││││└───────────────────────────────────────────
│││││││││┌ @ compiler/abstractinterpretation.jl:1243 fargs′ = Core.Compiler.getindex(fargs, Core.Compiler.:(3, Core.Compiler.lastindex(fargs)))
││││││││││ for 1 of union split cases, no matching method found for call signatures (Tuple{typeof(Core.Compiler.getindex), Nothing, Core.Compiler.UnitRange{Int64}})): fargs′ = Core.Compiler.getindex(fargs::Union{Nothing, Vector{Any}}, Core.Compiler.:(3, Core.Compiler.lastindex(fargs::Union{Nothing, Vector{Any}})::Int64)::Core.Compiler.UnitRange{Int64})
│││││││││└───────────────────────────────────────────
│││││││││┌ @ compiler/abstractinterpretation.jl:1244 Core.Compiler.getindex(fargs, 1)
││││││││││ for 1 of union split cases, no matching method found for call signatures (Tuple{typeof(Core.Compiler.getindex), Nothing, Int64})): Core.Compiler.getindex(fargs::Union{Nothing, Vector{Any}}, 1)
│││││││││└───────────────────────────────────────────
...
```
Keno pushed a commit that referenced this issue Oct 9, 2023
* add support for in source breakpoints

* ssa fixes

* simpler implementation
NHDaly pushed a commit that referenced this issue May 22, 2024
Cherry-pick the parts of #53355
which are relevant to the 1.10 GC.
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

4 participants