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

More invalidation fixes #35928

Merged
merged 8 commits into from
May 26, 2020
Merged

More invalidation fixes #35928

merged 8 commits into from
May 26, 2020

Conversation

timholy
Copy link
Sponsor Member

@timholy timholy commented May 18, 2020

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.

stdlib/REPL/src/docview.jl Outdated Show resolved Hide resolved
base/abstractdict.jl Outdated Show resolved Hide resolved
base/arrayshow.jl Outdated Show resolved Hide resolved
@timholy
Copy link
Sponsor Member Author

timholy commented May 18, 2020

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)
Copy link
Sponsor Member

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.

Copy link
Sponsor Member Author

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.

@timholy
Copy link
Sponsor Member Author

timholy commented May 19, 2020

Seeing if I can trigger tests.

@timholy timholy closed this May 19, 2020
@timholy timholy reopened this May 19, 2020
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.
@timholy
Copy link
Sponsor Member Author

timholy commented May 23, 2020

Barring objections, I'll merge this sometime early in the work week.

@timholy timholy merged commit 479097c into master May 26, 2020
@timholy timholy deleted the teh/ioctx_invalidations branch May 26, 2020 09:11
timholy added a commit that referenced this pull request Jun 26, 2020
Failed to import Base.show in #35928
@timholy timholy added the compiler:latency Compiler latency label Jun 27, 2020
timholy added a commit that referenced this pull request Jun 30, 2020
Failed to import Base.show in #35928
jmert added a commit to jmert/BitFlags.jl that referenced this pull request Sep 10, 2020
Duplicates the improvement made to Base's Enums: JuliaLang/julia#35928
jmert added a commit to jmert/BitFlags.jl that referenced this pull request Sep 10, 2020
Duplicates improvement made to Base's Enums: JuliaLang/julia#35928
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants