Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

certain recursive type definitions are not allocated inline #41349

Closed
simeonschaub opened this issue Jun 24, 2021 · 1 comment · Fixed by #41516
Closed

certain recursive type definitions are not allocated inline #41349

simeonschaub opened this issue Jun 24, 2021 · 1 comment · Fixed by #41516
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@simeonschaub
Copy link
Member

In this example, Julia does not realize that B can be allocated inline, which leads to B being boxed when used inside other types:

julia> struct A{T}
           x::Ptr{T}
       end

julia> struct B
           x::A{B}
       end

julia> B.name.flags
0x00
@simeonschaub simeonschaub added the types and dispatch Types, subtyping and method dispatch label Jun 24, 2021
@JeffBezanson
Copy link
Sponsor Member

There happens to be a test_broken for just this case:

@test_broken isbitstype(B33954)

simeonschaub added a commit that referenced this issue Jun 25, 2021
Marking this as RFC, since I am not certain that this is actually
correct. Is the branch for `dp->types == NULL` that looks at the type
parameters instead even needed here?
simeonschaub added a commit that referenced this issue Jun 25, 2021
Marking this as RFC, since I am not certain that this is actually
correct. Is the branch for `dp->types == NULL` that looks at the type
parameters instead even needed here?
simeonschaub added a commit that referenced this issue Jun 30, 2021
Marking this as RFC, since I am not certain that this is actually
correct.
vtjnash added a commit that referenced this issue Jul 8, 2021
Similar to #35275, but through a supertype instead of through the parameters
Fixes #41503
Fixes #41349
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants