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

avoid "type DataType has no field size" #148

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Conversation

visr
Copy link
Contributor

@visr visr commented Nov 1, 2022

This tries to avoid the issue described #147 that breaks this package on julia 1.9-DEV.

The julia change that triggers this is JuliaLang/julia#47170.
Looking at the changes in that PR I first tried to simply replace ty.size with Core.sizeof(ty), but that gave an error: "Type Symbol does not have a definite size."

Since

julia> isprimitivetype(Symbol)
false

julia> ismutabletype(Symbol)
true

I figured we could just use the short circuiting to avoid calling sizeof for Symbol by switching the order of the &&.

julia> (false || !true && error())
false

There may be a better way to fix this however.

@thautwarm thautwarm merged commit e9ba865 into thautwarm:main Nov 2, 2022
@thautwarm
Copy link
Owner

Thanks for the PR. I'll also refine the solution.

@visr visr deleted the patch-1 branch November 2, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants