Skip to content

Commit

Permalink
Merge pull request #25425 from JuliaLang/mb/reshapeundeferr
Browse files Browse the repository at this point in the history
Fix undefined var error in reshape error
  • Loading branch information
StefanKarpinski authored Jan 6, 2018
2 parents 7b82e50 + daa0262 commit 886900c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/reshapedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ _reshape(parent::Array, dims::Dims) = reshape(parent, dims)
# When reshaping Vector->Vector, don't wrap with a ReshapedArray
function _reshape(v::AbstractVector, dims::Dims{1})
len = dims[1]
len == length(v) || _throw_dmrs(n, "length", len)
len == length(v) || _throw_dmrs(_length(v), "length", len)
v
end
# General reshape
Expand Down
2 changes: 2 additions & 0 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ using Main.TestHelpers.OAs
@test a[2,1,2,2,1] == b[14]
@test a[2,2,2,2,2] == b[end]

@test_throws DimensionMismatch reshape(1:3, 4)

# issue #23107
a = [1,2,3]
@test typeof(a)(a) !== a
Expand Down

0 comments on commit 886900c

Please sign in to comment.