Skip to content

Commit f5afe58

Browse files
committed
use an explicit error check instead of the obscure type application
1 parent ee0f60e commit f5afe58

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

base/broadcast.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ function Base.ndims(BC::Type{<:Broadcasted{<:AbstractArrayStyle{N},Nothing}}) wh
289289
else
290290
# for `N isa Int`, only nonnegative values are allowed, indicating the number of dimensions
291291
let n = N::Int
292-
NTuple{n} # throw if negative
292+
if n < 0
293+
throw(ArgumentError("dimension count must not be negative"))
294+
end
293295
n
294296
end
295297
end

0 commit comments

Comments
 (0)