Skip to content

reduce type inference on 1.6 #40277

@mzgubic

Description

@mzgubic

On julia 1.5

julia> using Test

julia> x_vecs = ([5, ], [1.0, 2.0, 3.0]);

julia> @inferred reduce(vcat, x_vecs)
4-element Array{Float64,1}:
 5.0
 1.0
 2.0
 3.0

On julia 1.6

julia> @inferred reduce(vcat, x_vecs)
ERROR: return type Vector{Float64} does not match inferred return type AbstractVector{T} where T
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] top-level scope
   @ REPL[66]:1

julia> @inferred vcat(x_vecs...)
4-element Vector{Float64}:
 5.0
 1.0
 2.0
 3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:inferenceType inferenceregressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions