Skip to content

Commit 979087a

Browse files
authored
Merge pull request #85 from SciML/zero(StaticInt)
Define `zero(::StaticInt)`
2 parents 917bbac + 648ace4 commit 979087a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Static"
22
uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
33
authors = ["chriselrod", "ChrisRackauckas", "Tokazama"]
4-
version = "0.7.6"
4+
version = "0.7.7"
55

66
[deps]
77
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"

src/Static.jl

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ end
4343

4444
Base.getindex(x::Tuple, ::StaticInt{N}) where {N} = getfield(x, N)
4545

46+
Base.zero(@nospecialize(::StaticInt)) = StaticInt{0}()
47+
4648
Base.to_index(x::StaticInt) = known(x)
4749
function Base.checkindex(::Type{Bool}, inds::AbstractUnitRange, ::StaticNumber{N}) where {N}
4850
checkindex(Bool, inds, N)

0 commit comments

Comments
 (0)