https://github.com/JuliaLang/julia
Revision 47663bd28c91a629f7bf13ff1df979865b661f1c authored by Tamas K. Papp on 04 February 2024, 01:32:02 UTC, committed by GitHub on 04 February 2024, 01:32:02 UTC
Seeing implementation details like `Base.OneTo` in error messages may
be confusing to some users (cf discussion in #39242,
[discourse](https://discourse.julialang.org/t/promote-shape-dimension-mismatch/57529/)).

This PR turns
```julia
julia> ones(2, 3) + ones(3, 2)
ERROR: DimensionMismatch("dimensions must match: a has dims (Base.OneTo(2), Base.OneTo(3)), b has dims (Base.OneTo(3), Base.OneTo(2)), mismatch at 1")
```
into
```julia
julia> ones(2, 3) + ones(3, 2)
ERROR: DimensionMismatch("dimensions must match: a has size (2, 3), b has size (3, 2), mismatch at 1")
```

Fixes #40118. 

(This is basically #40124, but redone because I made a mess rebasing).

---------

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
1 parent 831cc14
History
Tip revision: 47663bd28c91a629f7bf13ff1df979865b661f1c authored by Tamas K. Papp on 04 February 2024, 01:32:02 UTC
Normalize indices in promote_shape error messages (#41311)
Tip revision: 47663bd
File Mode Size
startup.jl -rw-r--r-- 162 bytes

back to top