-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference
Description
Vararg handling in getfield_tfunc
is brittle:
julia> foo(xs::Union{Tuple{String}, Int}...) = getfield(xs...)
foo (generic function with 1 method)
julia> code_typed(foo)
1-element Vector{Any}:
CodeInfo(
1 ─ Core._apply_iterate(Base.iterate, Main.getfield, xs)::Union{}
└── unreachable
) => Union{}
julia> foo(("hello",), 1)
[27438] signal 4 (1): Illegal instruction: 4
in expression starting at REPL[3]:1
foo at ./REPL[1]:1
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XC9YQX9HH2.0/build/default-honeycrisp-XC9YQX9HH2-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
(Found while trying to understand enough of getfield_tfunc
and getfield_nothrow
to fix #56056 (comment))
topolarity, songjhaha and anqur
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference