From 048fc5e793f4df5122315d55cb045e9076547e14 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Tue, 17 Mar 2020 21:32:06 -0400 Subject: [PATCH] fix bug in t-function for `>:` (#35136) --- base/compiler/abstractinterpretation.jl | 2 +- test/compiler/inference.jl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/base/compiler/abstractinterpretation.jl b/base/compiler/abstractinterpretation.jl index de4f1b99b65fba..26763560e4b414 100644 --- a/base/compiler/abstractinterpretation.jl +++ b/base/compiler/abstractinterpretation.jl @@ -851,7 +851,7 @@ function abstract_call_known(@nospecialize(f), fargs::Union{Nothing,Vector{Any}} elseif la == 3 && istopfunction(f, :(>:)) # mark issupertype as a exact alias for issubtype # swap T1 and T2 arguments and call <: - if length(fargs) == 3 + if fargs !== nothing && length(fargs) == 3 fargs = Any[<:, fargs[3], fargs[2]] else fargs = nothing diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index 138f9f3056d058..0bc804e8073f99 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -2541,3 +2541,5 @@ end @test pickvarnames(Any[:a, :b]) === (:a, :b) @test only(Base.return_types(pickvarnames, (Vector{Any},))) == Tuple{Vararg{Union{Symbol, Tuple}}} @test only(Base.code_typed(pickvarnames, (Vector{Any},), optimize=false))[2] == Tuple{Vararg{Union{Symbol, Tuple{Vararg{Union{Symbol, Tuple}}}}}} + +@test map(>:, [Int], [Int]) == [true]