Skip to content

Parametric-type related crash on Julia 1.7+ #44614

Closed
@frankwswang

Description

@frankwswang

MWE:

struct T1{T}
    m::T
end

struct T2{L}
    tuple::NTuple{3, Int}

    function T2{L}(t::NTuple{3, Int}) where {L}
        new{sum(t)}(t)
    end
end

struct T3{L, N}
    a::Tuple{T2{L}}
    param::NTuple{N, T1}
    function T3(a::Tuple{T2{L}}, pars::NTuple{N, T1}) where {L, N}
        new{L, N}(a, pars)
    end
end

function f(ts)
    pars = []
    for t in ts
        append!(pars, t.param)
    end
    pars
end

t1_1 = ((T1{Float64}(1.0), T1{Int}(2)))

t1_2 = ((T1{Float64}(1.2), T1{Int}(1)))

t2_1 = (T2{1}((1,0,0)),)

t2_2 = (T2{2}((2,0,0)),)

[T3(t2_1, t1_1), T3(t2_2, t1_2)] |> f

Original Discourse discussion is here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionRegression in behavior compared to a previous versiontypes and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions