Skip to content

Commit

Permalink
Extend isinteger(::StaticInt) (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokazama committed Dec 3, 2022
1 parent ca1f741 commit 018a834
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Static"
uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
authors = ["chriselrod", "ChrisRackauckas", "Tokazama"]
version = "0.8.2"
version = "0.8.3"

[deps]
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
Expand Down
2 changes: 2 additions & 0 deletions src/Static.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ const IntType = Union{StaticInt, Int}
IntType(x::Integer) = Int(x)
IntType(@nospecialize x::Union{Int, StaticInt}) = x

Base.isinteger(@nospecialize x::StaticInt) = true

include("float.jl")

const StaticNumber{N} = Union{StaticInt{N}, StaticBool{N}, StaticFloat64{N}}
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ end

x = StaticInt(1)
y = static(3)
@test isinteger(y)
@test @inferred(minmax(x, y)) == @inferred(minmax(y, x)) == minmax(1, 3)
@test @inferred(Bool(x)) isa Bool
@test @inferred(BigInt(x)) isa BigInt
Expand Down

0 comments on commit 018a834

Please sign in to comment.