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

Summary errors out for UnitRange{<:BigInt} #26799

Closed
dlfivefifty opened this issue Apr 13, 2018 · 3 comments
Closed

Summary errors out for UnitRange{<:BigInt} #26799

dlfivefifty opened this issue Apr 13, 2018 · 3 comments
Labels
display and printing Aesthetics and correctness of printed representations of objects.

Comments

@dlfivefifty
Copy link
Contributor

julia> summary(BigInt(1):BigInt(10))
ERROR: MethodError: no method matching dims2string(::Tuple{BigInt})
Closest candidates are:
  dims2string(::Tuple{Vararg{Int64,N}} where N) at show.jl:1837
Stacktrace:
 [1] summary(::Base.GenericIOBuffer{Array{UInt8,1}}, ::UnitRange{BigInt}, ::Tuple{Base.OneTo{BigInt}}) at ./show.jl:1846
 [2] summary at ./show.jl:1844 [inlined]
 [3] summary(::UnitRange{BigInt}) at ./show.jl:1831
 [4] top-level scope

show works fine though because it doesn't call summary.

I'm happy to make a PR to fix dims2string to take in <:Integer.

@dlfivefifty
Copy link
Contributor Author

Actually, I see no reason why dims2string or inds2string should have restriction on the types.

@JeffBezanson
Copy link
Sponsor Member

Yes, agreed. Feel free to remove the type restrictions.

@JeffBezanson JeffBezanson added the display and printing Aesthetics and correctness of printed representations of objects. label Apr 13, 2018
@dlfivefifty
Copy link
Contributor Author

It looks like there are a few types that don't yet support BigInt:

julia> reshape(BigInt(1):BigInt(10), BigInt(1), BigInt(10))
ERROR: MethodError: no method matching reshape(::UnitRange{BigInt}, ::BigInt, ::BigInt)
Closest candidates are:
  reshape(::AbstractArray, ::Int64...) at reshapedarray.jl:95
  reshape(::AbstractArray, ::Union{Int64, AbstractUnitRange}...) at reshapedarray.jl:90
  reshape(::AbstractArray, ::Tuple{Vararg{Int64,N}} where N) at reshapedarray.jl:92

I could try to tackle these issues in a more expansive PR.

PS Surprisingly, view(a, BigInt(1):BigInt(3)) works fine apart from the printing bug.
PPS Motivation: when BigInt works well as an index, so does (https://github.com/JuliaApproximation/InfiniteArrays.jl)

mbauman added a commit that referenced this issue Apr 19, 2018
* origin/master: (22 commits)
  separate `isbitstype(::Type)` from `isbits` (#26850)
  bugfix for regex matches ending with non-ASCII (#26831)
  [NewOptimizer] track inbounds state as a per-statement flag
  change default LOAD_PATH and DEPOT_PATH (#26804, fix #25709)
  Change url scheme to https (#26835)
  [NewOptimizer] inlining: Refactor todo object
  inference: enable CodeInfo method_for_inference_limit_heuristics support (#26822)
  [NewOptimizer] Fix _apply elision (#26821)
  add test case from issue #26607, cfunction with no args (#26838)
  add `do` in front-end deparser. fixes #17781 (#26840)
  Preserve CallInst metadata in LateLowerGCFrame pass.
  Improve differences from R documentation (#26810)
  reserve syntax that could be used for computed field types (#18466) (#26816)
  Add support for Atomic{Bool} (Fix #26542). (#26597)
  Remove argument restriction on dims2string and inds2string (#26799) (#26817)
  remove some unnecessary `eltype` methods (#26791)
  optimize: ensure merge_value_ssa doesn't drop PiNodes
  inference: improve tmerge for Conditional and Const
  ensure more iterators stay type-stable
  code loading docs (#26787)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

2 participants