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

exclude types with free variables from type_morespecific #35555

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

JeffBezanson
Copy link
Member

After loading packages like Unitful and StaticArrays that overload show(io::IO, ::Type{<:T}) for some T a case like this basically hangs:

julia> struct X{A,B,C,D,E,F,G,H,I,J,K,L} end

julia> show(stdout, Union{Tuple{A}, Tuple{B}, Tuple{C}, Tuple{D}, Tuple{E}, Tuple{F}, Tuple{G}, Tuple{H}, Tuple{I}, Tuple{J}, Tuple{K}, Tuple{L}, Tuple{X{A,B,C,D,E,F,G,H,I,J,K,L}}} where {A,B,C,D,E,F,G,H,I,J,K,L})

Those definitions cause us to add dispatch cache entries with free variables, which then drives method sorting a bit crazy. This is definitely not a comprehensive solution, but it seems to fix this specific case.

@JeffBezanson JeffBezanson added types and dispatch Types, subtyping and method dispatch compiler:latency Compiler latency backport 1.4 labels Apr 22, 2020
@JeffBezanson JeffBezanson merged commit 0cedde6 into master Apr 27, 2020
@JeffBezanson JeffBezanson deleted the jb/morespecificfreevars branch April 27, 2020 17:47
mbauman added a commit that referenced this pull request Apr 28, 2020
* origin/master: (833 commits)
  Improve typesubtract for tuples (#35600)
  Make searchsorted*/findnext/findprev return values of keytype (#32978)
  fix buggy rand(RandomDevice(), Bool) (#35590)
  remove `Ref` allocation on task switch (#35606)
  Revert "partr: fix multiqueue resorting stability" (#35589)
  exclude types with free variables from `type_morespecific` (#35555)
  fix small typo in NEWS.md (#35611)
  enable inline allocation of structs with pointers (#34126)
  SparseArrays: Speed up right-division by diagonal matrices (#35533)
  Allow hashing 1D OffsetArrays
  NEWS item for introspection macros (#35594)
  Special case empty covec-diagonal-vec product (#35557)
  [GCChecker] fix a few tests by looking through casts
  Use norm instead of abs in generic lu factorization (#34575)
  [GCChecker,NFC] run clang-format -style=llvm
  [GCChecker] fix tests and add Makefile
  Add introspection macros support for dot syntax (#35522)
  Specialize `union` for `OneTo` (#35577)
  add pop!(vector, idx, [default]) (#35513)
  bump Pkg version (#35584)
  ...
KristofferC pushed a commit that referenced this pull request May 10, 2020
@KristofferC KristofferC mentioned this pull request May 10, 2020
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:latency Compiler latency types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant