-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
More invalidation fixes #35928
More invalidation fixes #35928
Conversation
If folks want to keep these commits separate for easier reversion in case of trouble I can rebase, or feel free to squash. |
@@ -29,7 +29,7 @@ Base.print(io::IO, x::Enum) = print(io, Symbol(x)) | |||
|
|||
function Base.show(io::IO, x::Enum) | |||
sym = Symbol(x) | |||
if !get(io, :compact, false) | |||
if !(get(io, :compact, false)::Bool) |
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.
Fortunately ::
already binds tighter than !
, but I can see how that might not be obvious to code readers.
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.
i can change it, but I felt that obviousness was worth a few extra characters.
770c306
to
a7b178f
Compare
Seeing if I can trigger tests. |
All of these "fields" are documented to be Bool, so this should not break any code and may improve error messages in case of user error. Usages like `if limit...`, `limit ? a : b`, or `limit && return nothing` do not need these fixes, since these are baked into the language rather than being handled by dispatch.
This prevents invalidation via `convert(::Type{Ptr{Cint}}, fd)`.
If you know you're building args of any Expr, you might as well start out collecting the arguments to a Vector{Any}, rather than using the clever type-narrowing machinery of collect/map/broadcast.
4bda5b1
to
b4e5128
Compare
Barring objections, I'll merge this sometime early in the work week. |
Failed to import Base.show in #35928
Failed to import Base.show in #35928
Duplicates the improvement made to Base's Enums: JuliaLang/julia#35928
Duplicates improvement made to Base's Enums: JuliaLang/julia#35928
These fix a fair number of the Base invalidations in #35922. If all these seem fine it could be merged, but many do arise from partial inference, and if we implement some of the suggestions in that issue then the changes to the following may not be so urgent:
convert(::Type{T}, x::AbstractDict) where T<:AbstractDict
cmp(a::AbstractString, b::AbstractString)
I doubt either of these would cause trouble, but I'm happy to drop those if Jeff or others think they are fixable by other means. To me, the rest seem like stuff we probably want.