-
Notifications
You must be signed in to change notification settings - Fork 62
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
Update type mutability check in IO.jl #409
base: main
Are you sure you want to change the base?
Conversation
LGTM! I'd like another maintainer to confirm that the Julia 1.6 compat bound looks good before merging. |
Project.toml
Outdated
@@ -36,7 +36,7 @@ RecipesBase = "0.7,1" | |||
StatsBase = "0.32,0.33" | |||
TextParse = "0.9.1,1" | |||
WeakRefStrings = "0.6" | |||
julia = "1" | |||
julia = "1.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ismutabletype
requires Julia 1.7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense to define a mutability check function that checks the Julia version and runs a compatible version of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The source of ismutabletype
looks pretty simple. We just need something like:
ismutabletype = if VERSION < v"1.7"
function ismutabletype(@nospecialize(t::Type))
t = unwrap_unionall(t)
return isa(t, DataType) && t.name.flags & 0x2 == 0x2
end
else
Base.ismutabletype
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Yo, sorry I dropped off the face of the planet. I removed the 1.6 requirement from compat, and created the version check for 1.7. I basically just copied your code except that I defined gave the new function the name _ismutabletype so that I did not get an error about redefining a constant. I only have 1.7 installed on my system, so I didn't test this on earlier versions of Julia. tagging @joshday and @jpsamaroo for visibility |
Fix bug (#408) that causes loading from a bin directory to fail due to deprecated type mutability check.
Changes:
IO.jl
to useismutabletype()