Skip to content

Nested parameterised structs fail to propagate bitstypeness in Julia 1.7.0 #43303

Closed
@ancapdev

Description

@ancapdev
Contributor

It appears 1.7.0 fails to correctly preserve bitstypeness of parameterised types in some situations. Here's a reproducible, original failing case was using UnsafeArrays.jl. In real world code, this leads to allocations and performance regressions.

Reproducible

struct UnsafeArray{T,N}
    pointer::Ptr{T}
    size::NTuple{N,Int}
end

struct X{T}
    x::T
end

struct Y{T}
    x::UnsafeArray{X{T}, 1}
end

struct Y2
    x::UnsafeArray{X{Int}, 1}
end

@show isbitstype(Y{Int})
@show isbitstype(UnsafeArray{Int, 1})
@show isbitstype(Y2)

Julia 1.7.0 output

isbitstype(Y{Int}) = false
isbitstype(UnsafeArray{Int, 1}) = true
isbitstype(Y2) = true

Julia 1.6.4 output

isbitstype(Y{Int}) = true
isbitstype(UnsafeArray{Int, 1}) = true
isbitstype(Y2) = true

Activity

changed the title [-]Nested parameterised structs fails to propagate bitstype in Julia 1.7.0[/-] [+]Nested parameterised structs fail to propagate bitstypeness in Julia 1.7.0[/+] on Dec 2, 2021
added
regressionRegression in behavior compared to a previous version
on Dec 2, 2021
self-assigned this
on Dec 2, 2021
added a commit that references this issue on Dec 2, 2021
6ff06e4
added a commit that references this issue on Dec 6, 2021
30fe8cc
added 2 commits that reference this issue on Dec 7, 2021
662e555
2a731a5
added a commit that references this issue on Feb 22, 2022
75b1730
added a commit that references this issue on Mar 8, 2022
83ea91a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

regressionRegression in behavior compared to a previous version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @vtjnash@ancapdev

    Issue actions

      Nested parameterised structs fail to propagate bitstypeness in Julia 1.7.0 · Issue #43303 · JuliaLang/julia