diff --git a/src/analyzers/jetanalyzer.jl b/src/analyzers/jetanalyzer.jl index 1184bfee9..1fcd97618 100644 --- a/src/analyzers/jetanalyzer.jl +++ b/src/analyzers/jetanalyzer.jl @@ -291,7 +291,8 @@ function CC.concrete_eval_eligible(analyzer::JETAnalyzer, if res === :concrete_eval return :concrete_eval end - elseif istopfunction(f, :fieldindex) + elseif (istopfunction(f, :fieldindex) || istopfunction(f, :typejoin) || + istopfunction(f, :typejoin_union_tuple)) if concrete_eval_eligible_ignoring_overlay(result, arginfo) return :concrete_eval end diff --git a/test/analyzers/test_jetanalyzer.jl b/test/analyzers/test_jetanalyzer.jl index 7665374e3..83675cd4d 100644 --- a/test/analyzers/test_jetanalyzer.jl +++ b/test/analyzers/test_jetanalyzer.jl @@ -1135,6 +1135,17 @@ end |> only === Val{1} end |> only === Val{3} @test_call sort([1,2,3]) @test_call sort!([1,2,3]) +# aviatesk/JET.jl#669 +@static if VERSION ≥ v"1.11-" +struct Point669{dim,T} + coord::NTuple{dim,T} +end +getcoordinate669(n) = n.coord +f669(p) = getcoordinate669.(p) +let pts = Point669.(rand(NTuple{2,Float64}, 10)) + @test_call f669(pts) +end +end # @static if VERSION ≥ v"1.11-" @test isconcretetype(only(Base.return_types(pairs, (@NamedTuple{kw1::Int,kw2::String},); interp=JET.JETAnalyzer())))