-
Notifications
You must be signed in to change notification settings - Fork 15
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
Lots of warnings are nonsense #41
Comments
IIRC this warning tries to figure out when a binding changes type, so e.g. was a |
Okay that makes sense to warn about. Even if the variable name was displayed, I might not have understood that it was the fact that the type changed that was warned about. Maybe a better message is
or something like that. Also, if I'm not mistaken, the compiler is much better at optimizing for code where varibales change type nowadays, as long as it is visible at compile time. |
Agreed.
True. It's also much better about small unions ( |
I also ran into this. The weird thing is not only the missing variable name, but also |
It's not always trivial to find the correct line info, but yes, probably a bug. |
I have similar things julia> @trace reactran_fvcf(dC0,C_uni,false,1)
┌ Warning: dynamic dispatch to (Core.apply_type(Base.Val, x))()
└ @ essentials.jl:696
┌ Warning: is assigned as Tuple{Int64,Int64}
└ @ D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\bidiag.jl:539
┌ Warning: is assigned as Nothing
└ @ D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\bidiag.jl:546
┌ Warning: is assigned as Union{Nothing, Tuple{Int64,Int64}}
└ @ D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\bidiag.jl:542
┌ Warning: is assigned as Union{Nothing, Tuple{Int64,Int64}}
└ @ D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\bidiag.jl:544
┌ Warning: dynamic dispatch to LinearAlgebra.A_mul_B_td!(C, A, B, φ (%5 => %4, %7 => %6, %11 => %10, %13 => %12))
└ @ D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\bidiag.jl:391
┌ Warning: getindex returns Union{SubArray{Float64,1,Array{Float64,1},Tuple{StepRange{Int64,Int64}},true}, Array{Float64,1}}
└ @ tuple.jl:24
┌ Warning: getindex returns Union{Base.Broadcast.Extruded{SubArray{Float64,1,Array{Float64,1},Tuple{StepRange{Int64,Int64}},true},Tuple{Bool},Tuple{Int64}}, Base.Broadcast.Extruded{Array{Float64,1},Tuple{Bool},Tuple{Int64}}}
└ @ tuple.jl:24
┌ Warning: is assigned as Tuple{Int64,Int64}
└ @ broadcast.jl:70
┌ Warning: is assigned as Nothing
└ @ broadcast.jl:79
┌ Warning: getindex returns Union{SubArray{Float64,1,Array{Float64,1},Tuple{StepRange{Int64,Int64}},true}, Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(*),Tuple{Array{Float64,1},Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(-),Tuple{Float64,SubArray{Float64,1,Array{Float64,1},Tuple{StepRange{Int64,Int64}},true}}}}}}
└ @ tuple.jl:24
┌ Warning: getindex returns Union{Base.Broadcast.Broadcasted{Base.Broadcast.DefaultArrayStyle{1},Nothing,typeof(-),Tuple{Float64,SubArray{Float64,1,Array{Float64,1},Tuple{StepRange{Int64,Int64}},true}}}, Array{Float64,1}}
└ @ tuple.jl:24
┌ Warning: getindex returns Union{Float64, SubArray{Float64,1,Array{Float64,1},Tuple{StepRange{Int64,Int64}},true}}
└ @ tuple.jl:24 What I don't understand is how do we where are they referring to in my code? It only returns the line numbers of the package codes. |
It looks to me like it's analyzing code in packages? I only want to analyze the code I've written. Is there any way to do this?
|
You can specify the |
Minimum working example: julia> using Traceur
julia> f(x) = [x]
julia> @trace f(0)
┌ Warning: is assigned as Tuple{Int64, Int64}
└ @ array.jl:108
┌ Warning: is assigned as Nothing
└ @ array.jl:108
1-element Vector{Int64}:
0 With https://github.com/JuliaLang/julia/blob/06e7ee6ce8277035cc4ae6d0a365698f2f5bb347/base/array.jl#L108 It seems related to the julia> function f3()
for i = 1:2
end
end
julia> @trace f3()
┌ Warning: is assigned as Tuple{Int64, Int64}
└ @ REPL[8]:2
┌ Warning: is assigned as Union{Nothing, Tuple{Int64, Int64}}
└ @ REPL[8]:3 |
I do not understand the following warnings, the variable names seems to be left out and is it really a problem if something is assigned as
Nothing
or aTuple
?The text was updated successfully, but these errors were encountered: