We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
function foo(x) a = x ? (1,2) : nothing a::Tuple a[1] end
@code_warntype foo(true) Variables: x::Bool a::Union{Nothing, Tuple{Int64,Int64}} #temp#@_4::Union{Nothing, Tuple{Int64,Int64}} #temp#@_5::Int64 Body: begin unless x::Bool goto 4 #temp#@_4::Union{Nothing, Tuple{Int64,Int64}} = (1, 2) goto 6 4: #temp#@_4::Union{Nothing, Tuple{Int64,Int64}} = Main.nothing 6: a::Union{Nothing, Tuple{Int64,Int64}} = #temp#@_4::Union{Nothing, Tuple{Int64,Int64}} #= line 3 =# (Core.typeassert)(a::Union{Nothing, Tuple{Int64,Int64}}, Main.Tuple)::Tuple{Int64,Int64} #= line 4 =# SSAValue(1) = (a::Union{Nothing, Tuple{Int64,Int64}} isa Tuple{Int64,Int64})::Bool unless SSAValue(1) goto 15 #temp#@_5::Int64 = $(Expr(:invoke, MethodInstance for getindex(::Tuple{Int64,Int64}, ::Int64), :(Main.getindex), :(a), 1))::Int64 goto 20 15: goto 17 17: #temp#@_5::Int64 = (Main.getindex)(a::Union{Nothing, Tuple{Int64,Int64}}, 1)::Int64 goto 20 20: SSAValue(0) = #temp#@_5::Int64 return SSAValue(0) end::Int64
There should be a TypedSlot on the getindex since we know that after the typeassert a can't be nothing.
getindex
a
nothing
The text was updated successfully, but these errors were encountered:
vtjnash
No branches or pull requests
There should be a TypedSlot on the
getindex
since we know that after the typeasserta
can't benothing
.The text was updated successfully, but these errors were encountered: