diff --git a/src/int.jl b/src/int.jl index b9110b2..fdbcbde 100644 --- a/src/int.jl +++ b/src/int.jl @@ -138,3 +138,4 @@ Base.UnitRange(start::StaticInt, stop) = UnitRange(Int(start), stop) Base.UnitRange(start, stop::StaticInt) = UnitRange(start, Int(stop)) Base.UnitRange(start::StaticInt, stop::StaticInt) = UnitRange(Int(start), Int(stop)) +Base.eltype(::Base.OneTo{StaticInt{N}}) where {N} = Int diff --git a/test/runtests.jl b/test/runtests.jl index 6c1408e..57850b0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -79,6 +79,8 @@ using Test @test static(Int32(-18)) === static(-18) @test static(0xffffffef) === static(4294967279) end + + @test collect(Base.OneTo(static(3))) == collect(Base.OneTo(3)) end @testset "StaticBool" begin